summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2018-09-15 01:53:19 +0000
committerDaniel Vetter <daniel.vetter@ffwll.ch>2018-09-21 10:50:45 +0200
commit14e86c01413ed4cb69525e5eb60731d03ea7630c (patch)
treef6eac5294247e400af87f597ff2f9790ba6a8c2e /drivers
parent4f724df717c6d2334d01c93a6a89755691ae4440 (diff)
downloadlinux-14e86c01413ed4cb69525e5eb60731d03ea7630c.tar.bz2
drm/vkms: Fix possible memory leak in _vkms_get_crc()
'vaddr_out' is malloced in _vkms_get_crc() and should be freed before leaving from the error handling cases, otherwise it will cause memory leak. Fixes: db7f419c06d7 ("drm/vkms: Compute CRC with Cursor Plane") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/1536976399-1295-1-git-send-email-weiyongjun1@huawei.com
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/vkms/vkms_crc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vkms/vkms_crc.c b/drivers/gpu/drm/vkms/vkms_crc.c
index 0a2745646dfa..9d9e8146db90 100644
--- a/drivers/gpu/drm/vkms/vkms_crc.c
+++ b/drivers/gpu/drm/vkms/vkms_crc.c
@@ -125,6 +125,7 @@ static uint32_t _vkms_get_crc(struct vkms_crc_data *primary_crc,
mutex_lock(&vkms_obj->pages_lock);
if (WARN_ON(!vkms_obj->vaddr)) {
mutex_unlock(&vkms_obj->pages_lock);
+ kfree(vaddr_out);
return crc;
}