drm/vmwgfx: Fix memory leak in vmw_mksstat_add_ioctl()
authorRafael Mendonca <rafaelmendsr@gmail.com>
Fri, 16 Sep 2022 20:47:51 +0000 (17:47 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 10:34:55 +0000 (12:34 +0200)
commitb47a37ad4a444d82f9caf153a79d090b79786ebb
tree82987b1cdddd32c0e01f7ad4d4bb54058bc922c2
parentbdf54d4b00747aa2ddeb4ebc102e9dfdeb07c246
drm/vmwgfx: Fix memory leak in vmw_mksstat_add_ioctl()

[ Upstream commit a40c7f61d12fbd1e785e59140b9efd57127c0c33 ]

If the copy of the description string from userspace fails, then the page
for the instance descriptor doesn't get freed before returning -EFAULT,
which leads to a memleak.

Fixes: 7a7a933edd6c ("drm/vmwgfx: Introduce VMware mks-guest-stats")
Signed-off-by: Rafael Mendonca <rafaelmendsr@gmail.com>
Reviewed-by: Martin Krastev <krastevm@vmware.com>
Signed-off-by: Zack Rusin <zackr@vmware.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220916204751.720716-1-rafaelmendsr@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/vmwgfx/vmwgfx_msg.c