Skip to content

Commit a40c7f6

Browse files
rafaelmsoareszackr
authored andcommitted
drm/vmwgfx: Fix memory leak in vmw_mksstat_add_ioctl()
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: 7a7a933 ("drm/vmwgfx: Introduce VMware mks-guest-stats") Signed-off-by: Rafael Mendonca <[email protected]> Reviewed-by: Martin Krastev <[email protected]> Signed-off-by: Zack Rusin <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 110ae8a commit a40c7f6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/gpu/drm/vmwgfx/vmwgfx_msg.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,6 +1076,7 @@ int vmw_mksstat_add_ioctl(struct drm_device *dev, void *data,
10761076

10771077
if (desc_len < 0) {
10781078
atomic_set(&dev_priv->mksstat_user_pids[slot], 0);
1079+
__free_page(page);
10791080
return -EFAULT;
10801081
}
10811082

0 commit comments

Comments
 (0)