diff options
author | Haneen Mohammed <hamohammed.sa@gmail.com> | 2018-08-03 23:11:42 +0300 |
---|---|---|
committer | Sean Paul <seanpaul@chromium.org> | 2018-08-03 23:14:56 +0300 |
commit | bc0d332daef3fb9f58e34cb4d03d99f2c84b11cb (patch) | |
tree | 5d7c367110d18840210295d5c80f8588048a4548 /drivers/gpu/drm/vkms | |
parent | 6c234fe37c57627a5baf96f552afa1fae2b67d4d (diff) | |
download | linux-bc0d332daef3fb9f58e34cb4d03d99f2c84b11cb.tar.xz |
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 <hamohammed.sa@gmail.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20180803201142.GA2206@haneenDRM
Diffstat (limited to 'drivers/gpu/drm/vkms')
-rw-r--r-- | drivers/gpu/drm/vkms/vkms_crc.c | 5 |
1 files 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; } |