mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Zou Wei <zou_wei@huawei.com>,
	maarten.lankhorst@linux.intel.com, mripard@kernel.org,
	airlied@linux.ie, daniel@ffwll.ch
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] drm/aperture: Fix missing unlock on error in devm_aperture_acquire()
Date: Thu, 13 May 2021 15:08:17 +0200	[thread overview]
Message-ID: <bc0b8b71-507d-c6c2-9029-359c7f27daf4@suse.de> (raw)
In-Reply-To: <1620895564-52367-1-git-send-email-zou_wei@huawei.com>


[-- Attachment #1.1: Type: text/plain, Size: 1471 bytes --]

Hi

Am 13.05.21 um 10:46 schrieb Zou Wei:
> Add the missing unlock before return from function devm_aperture_acquire()
> in the error handling case.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zou Wei <zou_wei@huawei.com>

I added a Fixes tag and queued up the patch for drm-misc-next. Thanks!

Best regards
Thomas

> ---
>   drivers/gpu/drm/drm_aperture.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_aperture.c b/drivers/gpu/drm/drm_aperture.c
> index 33bf018..9335d9d 100644
> --- a/drivers/gpu/drm/drm_aperture.c
> +++ b/drivers/gpu/drm/drm_aperture.c
> @@ -164,13 +164,17 @@ static int devm_aperture_acquire(struct drm_device *dev,
>   
>   	list_for_each(pos, &drm_apertures) {
>   		ap = container_of(pos, struct drm_aperture, lh);
> -		if (overlap(base, end, ap->base, ap->base + ap->size))
> +		if (overlap(base, end, ap->base, ap->base + ap->size)) {
> +			mutex_unlock(&drm_apertures_lock);
>   			return -EBUSY;
> +		}
>   	}
>   
>   	ap = devm_kzalloc(dev->dev, sizeof(*ap), GFP_KERNEL);
> -	if (!ap)
> +	if (!ap) {
> +		mutex_unlock(&drm_apertures_lock);
>   		return -ENOMEM;
> +	}
>   
>   	ap->dev = dev;
>   	ap->base = base;
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

      reply	other threads:[~2021-05-13 13:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-13  8:46 Zou Wei
2021-05-13 13:08 ` Thomas Zimmermann [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=bc0b8b71-507d-c6c2-9029-359c7f27daf4@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=zou_wei@huawei.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

all inboxes | Powered by JetHome®