Commit bc0d332d authored by Haneen Mohammed's avatar Haneen Mohammed Committed by Sean Paul

drm/vkms: Release pages_lock before return

Release pages_lock before return when vkms_obj->vaddr is NULL.
This patch fixes: 6c234fe3 ("drm/vkms: Implement CRC debugfs API").
Signed-off-by: default avatarHaneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: default avatarSean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20180803201142.GA2206@haneenDRM
parent 6c234fe3
...@@ -22,14 +22,15 @@ static uint32_t _vkms_get_crc(struct vkms_crc_data *crc_data) ...@@ -22,14 +22,15 @@ static uint32_t _vkms_get_crc(struct vkms_crc_data *crc_data)
mutex_lock(&vkms_obj->pages_lock); mutex_lock(&vkms_obj->pages_lock);
vaddr = vkms_obj->vaddr; vaddr = vkms_obj->vaddr;
if (WARN_ON(!vaddr)) if (WARN_ON(!vaddr))
return crc; goto out;
for (i = y; i < y + height; i++) { for (i = y; i < y + height; i++) {
src_offset = fb->offsets[0] + (i * fb->pitches[0]) + (x * cpp); src_offset = fb->offsets[0] + (i * fb->pitches[0]) + (x * cpp);
crc = crc32_le(crc, vaddr + src_offset, size_byte); crc = crc32_le(crc, vaddr + src_offset, size_byte);
} }
mutex_unlock(&vkms_obj->pages_lock);
out:
mutex_unlock(&vkms_obj->pages_lock);
return crc; return crc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment