提交 6b7c3b86 编写于 作者: C Colin Ian King 提交者: Thomas Hellstrom

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: a9cd9c04 ("drm/vmwgfx: Add a check to handle host message failure")
Signed-off-by: NColin Ian King <colin.king@canonical.com>
Reviewed-by: NDeepak Rawat <drawat@vmware.com>
Signed-off-by: NDeepak Rawat <drawat@vmware.com>
Signed-off-by: NThomas Hellstrom <thellstrom@vmware.com>
上级 f536579c
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册