Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp336908pxj; Thu, 13 May 2021 06:12:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/CbOqHxXJP8XFdCZXzw/alAFLg+Z12ZhJHFqi/ot5JnnPr5NmzviTNMHouvhxYB7135Ef X-Received: by 2002:ac2:52a9:: with SMTP id r9mr29405218lfm.308.1620911544085; Thu, 13 May 2021 06:12:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620911544; cv=none; d=google.com; s=arc-20160816; b=Z1IDfkFaMUwbHnAoaNLB5si9xsFM2slSoJFNHUFN12xrKuwvUHxJnYoFWt4IM10a2q JjjwA9cPTqy96x5DMYwACTW25oaRr1iG+HJzf/+VscNCgE0nofTQE86QAsYIk0SIVbsF eyUD4XXgeaQ+1MR33+EiTVbk5xHo5DXeLoHyABMaAtKHOldYdULbhb93e2Sbbn2WupVN KNP8QUarm2L30sXONWproARRoytfqAqRu+vmI4XzFkCYusx8rnC42yChbszy6wm+lTem MD3q1dSun+u4krnBxgbStBIu8lDkrN78mESnId3I72MmcGwG7+eV+q7VFWDikL88aZ9+ X9VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=/xbstarbK3yJMgTKs3R7RKB3Z00jvmfv7LLEHFfx+Ng=; b=X5Y7qd65sDyr3en9umX1sEG0RG6MAfbo3jq6rMhX7CQjyOpbrtI6twF/eLOHmlLUBG E0ucaFK1NKyzmQTMl+ewFugGSHZG5yjO2AcfRoZBrEkXxEF2pal8KerylP/TLBo/hazr LCyFGmeOEc7Yyut+IzzsDm4/PhzY9TXibxGsAXvm5gJuSvh/znPBaUcVSKn18Kql12io onlWUoSrh915DVByD9umXf6jMPJyyO0N9jF+/dCAyEfMHToNU6wzFJRV9BGGOGCQrU09 ZINK2kxjxo65Ys0SLQR7WQtavsPOAIuiB+6tsi53942I7Po9iSqCEo1GY5OzxoVLHDVa rOCg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b14si3407840lfp.246.2021.05.13.06.11.51; Thu, 13 May 2021 06:12:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233828AbhEMNJf (ORCPT + 99 others); Thu, 13 May 2021 09:09:35 -0400 Received: from mx2.suse.de ([195.135.220.15]:43640 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230498AbhEMNJ3 (ORCPT ); Thu, 13 May 2021 09:09:29 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 1976BAE57; Thu, 13 May 2021 13:08:19 +0000 (UTC) Subject: Re: [PATCH -next] drm/aperture: Fix missing unlock on error in devm_aperture_acquire() To: Zou Wei , 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 References: <1620895564-52367-1-git-send-email-zou_wei@huawei.com> From: Thomas Zimmermann Message-ID: Date: Thu, 13 May 2021 15:08:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <1620895564-52367-1-git-send-email-zou_wei@huawei.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2LYd2hGxsv9U9ONrL0OFzeYrSnmGgUNVz" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --2LYd2hGxsv9U9ONrL0OFzeYrSnmGgUNVz Content-Type: multipart/mixed; boundary="Pv7MotVf5ovpQSqaWZ0JWXWfLBQj6bAYF"; protected-headers="v1" From: Thomas Zimmermann To: Zou Wei , 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 Message-ID: Subject: Re: [PATCH -next] drm/aperture: Fix missing unlock on error in devm_aperture_acquire() References: <1620895564-52367-1-git-send-email-zou_wei@huawei.com> In-Reply-To: <1620895564-52367-1-git-send-email-zou_wei@huawei.com> --Pv7MotVf5ovpQSqaWZ0JWXWfLBQj6bAYF Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hi Am 13.05.21 um 10:46 schrieb Zou Wei: > Add the missing unlock before return from function devm_aperture_acquir= e() > in the error handling case. >=20 > Reported-by: Hulk Robot > Signed-off-by: Zou Wei 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(-) >=20 > diff --git a/drivers/gpu/drm/drm_aperture.c b/drivers/gpu/drm/drm_apert= ure.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_devic= e *dev, > =20 > list_for_each(pos, &drm_apertures) { > ap =3D 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; > + } > } > =20 > ap =3D devm_kzalloc(dev->dev, sizeof(*ap), GFP_KERNEL); > - if (!ap) > + if (!ap) { > + mutex_unlock(&drm_apertures_lock); > return -ENOMEM; > + } > =20 > ap->dev =3D dev; > ap->base =3D base; >=20 --=20 Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany (HRB 36809, AG N=C3=BCrnberg) Gesch=C3=A4ftsf=C3=BChrer: Felix Imend=C3=B6rffer --Pv7MotVf5ovpQSqaWZ0JWXWfLBQj6bAYF-- --2LYd2hGxsv9U9ONrL0OFzeYrSnmGgUNVz Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEExndm/fpuMUdwYFFolh/E3EQov+AFAmCdJMEFAwAAAAAACgkQlh/E3EQov+Bh fw//T1Y3PBtm36xSAjECT3jg/7zd4WOP89zbgzF6GBPFGoDf+63SbcAP6AkbA9U8/wU1XwmMC5tn 7SqaE7h1mMp2d0+h/OtU7/WVInyFEVoYG3S1KtmdiqjNMu+YAtIbTbwaYnw+4NdgRD3pZ0VTYc1Z fhyce77rCvruYxWLgPdUell2SylKe8URuGB8Rgh40v5DkAx/6DZ1m4RKSS8sKWZxydDliVWayXAs uYzBdydq/XOoq+Nq8rzaJMC+MUCiE0T2iqLgC9PR5UYMIBM84VK/jefiLWrYWatUk5HLScPQmAb1 +7y5y4Aqt0kiom810plXO+DneYcCHm0q9PNPYEOHdsoaCE3+wHoV/VHnnzZ5ShTgJl6ovGrRMRm0 pxJ6p8aqALIQUDXJyBQPZLkTlMKS+92SR49WmKZzHAtvmXOKx6Vzx0Fuk3WKot2UHuNHiS3XAh/l URyyDmylCGc5wm4YDR8NQRFf9FeYTqvPSxMxHro9s49y2JhXU2MC1qLCmm6TApceoI9Tw2yoEX/W cejQGquZPKtNThZtVRPOejXwKNJbXhsGlDLKDJghVAkw+szKFartVXYpnS6U5sErAhEvOTGZFGlY 3h/eQ99RnnGLimHc4PFjmSwFKKCATkpslGbd8TEXCT+Al4myMRUnTYOYkkFExQtzYy98/vh8GjvN JpQ= =vxrH -----END PGP SIGNATURE----- --2LYd2hGxsv9U9ONrL0OFzeYrSnmGgUNVz--