1
0
Fork 0

drm/vmwgfx: fix memory leak when too many retries have occurred

Currently when too many retries have occurred there is a memory
leak on the allocation for reply on the error return path. Fix
this by kfree'ing reply before returning.

Addresses-Coverity: ("Resource leak")
Fixes: a9cd9c044a ("drm/vmwgfx: Add a check to handle host message failure")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Deepak Rawat <drawat@vmware.com>
Signed-off-by: Deepak Rawat <drawat@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
alistair/sunxi64-5.4-dsi
Colin Ian King 2019-06-24 09:39:59 -07:00 committed by Thomas Hellstrom
parent f536579c14
commit 6b7c3b86f0
1 changed files with 3 additions and 1 deletions

View File

@ -389,8 +389,10 @@ static int vmw_recv_msg(struct rpc_channel *channel, void **msg,
break;
}
if (retries == RETRIES)
if (retries == RETRIES) {
kfree(reply);
return -EINVAL;
}
*msg_len = reply_len;
*msg = reply;