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:
Haneen Mohammed 2018-08-03 23:11:42 +03:00 committed by Sean Paul
parent 6c234fe37c
commit bc0d332dae

View file

@ -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;
}