From bc0d332daef3fb9f58e34cb4d03d99f2c84b11cb Mon Sep 17 00:00:00 2001 From: Haneen Mohammed Date: Fri, 3 Aug 2018 23:11:42 +0300 Subject: [PATCH] drm/vkms: Release pages_lock before return Release pages_lock before return when vkms_obj->vaddr is NULL. This patch fixes: 6c234fe37c57 ("drm/vkms: Implement CRC debugfs API"). Signed-off-by: Haneen Mohammed Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20180803201142.GA2206@haneenDRM --- drivers/gpu/drm/vkms/vkms_crc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vkms/vkms_crc.c b/drivers/gpu/drm/vkms/vkms_crc.c index 9b909221943f..37d717f38e3c 100644 --- a/drivers/gpu/drm/vkms/vkms_crc.c +++ b/drivers/gpu/drm/vkms/vkms_crc.c @@ -22,14 +22,15 @@ static uint32_t _vkms_get_crc(struct vkms_crc_data *crc_data) mutex_lock(&vkms_obj->pages_lock); vaddr = vkms_obj->vaddr; if (WARN_ON(!vaddr)) - return crc; + goto out; for (i = y; i < y + height; i++) { src_offset = fb->offsets[0] + (i * fb->pitches[0]) + (x * cpp); crc = crc32_le(crc, vaddr + src_offset, size_byte); } - mutex_unlock(&vkms_obj->pages_lock); +out: + mutex_unlock(&vkms_obj->pages_lock); return crc; } -- 2.30.2