dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Paul <seanpaul@chromium.org>
To: Haneen Mohammed <hamohammed.sa@gmail.com>
Cc: rodrigosiqueiramelo@gmail.com, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/vkms: Release pages_lock before return
Date: Fri, 3 Aug 2018 16:20:24 -0400	[thread overview]
Message-ID: <20180803202024.GP20303@art_vandelay> (raw)
In-Reply-To: <20180803201142.GA2206@haneenDRM>

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@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
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2018-08-03 20:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-03 20:11 [PATCH] drm/vkms: Release pages_lock before return Haneen Mohammed
2018-08-03 20:20 ` Sean Paul [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180803202024.GP20303@art_vandelay \
    --to=seanpaul@chromium.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hamohammed.sa@gmail.com \
    --cc=rodrigosiqueiramelo@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox