mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
drm/vkms: Release pages_lock before return
Release pages_lock before return when vkms_obj->vaddr is NULL.
This patch fixes: 6c234fe37c
("drm/vkms: Implement CRC debugfs API").
Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20180803201142.GA2206@haneenDRM
This commit is contained in:
parent
6c234fe37c
commit
bc0d332dae
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue