提交 a40c7f61 编写于 作者: R Rafael Mendonca 提交者: Zack Rusin

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: 7a7a933e ("drm/vmwgfx: Introduce VMware mks-guest-stats")
Signed-off-by: NRafael Mendonca <rafaelmendsr@gmail.com>
Reviewed-by: NMartin Krastev <krastevm@vmware.com>
Signed-off-by: NZack Rusin <zackr@vmware.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220916204751.720716-1-rafaelmendsr@gmail.com
上级 110ae8a2
......@@ -1076,6 +1076,7 @@ int vmw_mksstat_add_ioctl(struct drm_device *dev, void *data,
if (desc_len < 0) {
atomic_set(&dev_priv->mksstat_user_pids[slot], 0);
__free_page(page);
return -EFAULT;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册