[PATCH] drm/vkms: Release pages_lock before return

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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.17.1

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux