[PATCH] drm/vkms: Release pages_lock before return

Sean Paul seanpaul at chromium.org
Fri Aug 3 20:20:24 UTC 2018


On Fri, Aug 03, 2018 at 11:11:42PM +0300, Haneen Mohammed wrote:
> 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 at gmail.com>

Thanks for fixing this up. Pushed to drm-misc-next.

Sean

> ---
>  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
> 

-- 
Sean Paul, Software Engineer, Google / Chromium OS


More information about the dri-devel mailing list