Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2842839ybb; Sun, 22 Mar 2020 09:01:58 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtYFJJe9ZGR+Mu6Lj2GYAsHJSw5TZ5SiIWBaQUK6ePfZyjqIaBmpoYuetONbivfTOs/ADtI X-Received: by 2002:a54:488b:: with SMTP id r11mr14455113oic.24.1584892917933; Sun, 22 Mar 2020 09:01:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584892917; cv=none; d=google.com; s=arc-20160816; b=d05oyfx4yZrzfyyNuHSd8X3sax7ANsxMBGCGFTT8GBgnFFmlQwXip3PDK9pQVADo0S 6SXGe7WkZJMP4XOTcPWAL5//Q5zq7D0PgWSqHgsZWG097w2jayNOlwvcm4/wYikwNm22 xzaP8nuBNr6IKu0FyuApyJASx4DVMLk6OsDh6KB5DPhKfSwxBCPnsUYqRTBpl8/dWEA8 88AR846Y+C51hZTUZsoBGde/P/L5aRRNJD6PYIXRUVK3ikmx03XQ6d2qaIqBQg1dck+f yqY+Wlk3KuEyYyhl2d+Wp8PAAYzN125wCdG8o7t3zNFAsCfvOY5KwirbuW3AvS/d6huV yWJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=s6O6SZV12IbCJqpOTrm3j7qqG+xJoLfYQ+BLbcQkLF8=; b=Kdg4kEaLvnK9S/qX8ys48wYRruXHv9CusXSiMv28WaJxyr5Mzmj3vYZe5paySrtoTf IpzkyOlOSOqdLSVFjZxU4R4kWS5YriHS+Eneq6kSaJbZSJ6eQk3yeVU6uGTFYNNRDQZa 7pyUXzoyj0GHdjxBRo2CVreb0ECqx8RoSouFs8ma2rka0z654HwQYZkyHGxfrIZDsvve uCEpFqrWX3wyKCMNMLXvEVdRXV0ODVwAlL9e7yUlWDl2DSEB87kGeEII1yLsPDG00JBD ycSCMD/kEB+Ij30Js3D8gS3RIT1ABWMNCvOrrifSTv+z7enQd5EI3hjn0R5xQo0PkldL GGsg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u191si6449333oia.148.2020.03.22.09.01.45; Sun, 22 Mar 2020 09:01:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726875AbgCVQAn (ORCPT + 99 others); Sun, 22 Mar 2020 12:00:43 -0400 Received: from sauhun.de ([88.99.104.3]:51172 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726502AbgCVQAn (ORCPT ); Sun, 22 Mar 2020 12:00:43 -0400 Received: from localhost (p54B33042.dip0.t-ipconnect.de [84.179.48.66]) by pokefinder.org (Postfix) with ESMTPSA id ADCB32C0064; Sun, 22 Mar 2020 17:00:40 +0100 (CET) Date: Sun, 22 Mar 2020 17:00:40 +0100 From: Wolfram Sang To: Chuhong Yuan , Jan Glauber Cc: David Daney , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] i2c: thunderx: Add missed pci_release_regions Message-ID: <20200322160040.GD1091@ninjato> References: <20191206075349.18297-1-hslester96@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="n/aVsWSeQ4JHkrmm" Content-Disposition: inline In-Reply-To: <20191206075349.18297-1-hslester96@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --n/aVsWSeQ4JHkrmm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 06, 2019 at 03:53:49PM +0800, Chuhong Yuan wrote: > The driver forgets to call pci_release_regions() in probe failure > and remove. > Add the missed calls to fix it. >=20 > Signed-off-by: Chuhong Yuan Jan, any comment to this patch? Chuhong Yang, please make sure you have a proper To-Header next time! > --- > drivers/i2c/busses/i2c-thunderx-pcidrv.c | 19 ++++++++++++------- > 1 file changed, 12 insertions(+), 7 deletions(-) >=20 > diff --git a/drivers/i2c/busses/i2c-thunderx-pcidrv.c b/drivers/i2c/busse= s/i2c-thunderx-pcidrv.c > index 19f8eec38717..31f7e254e99f 100644 > --- a/drivers/i2c/busses/i2c-thunderx-pcidrv.c > +++ b/drivers/i2c/busses/i2c-thunderx-pcidrv.c > @@ -172,8 +172,10 @@ static int thunder_i2c_probe_pci(struct pci_dev *pde= v, > return ret; > =20 > i2c->twsi_base =3D pcim_iomap(pdev, 0, pci_resource_len(pdev, 0)); > - if (!i2c->twsi_base) > - return -EINVAL; > + if (!i2c->twsi_base) { > + ret =3D -EINVAL; > + goto error_release_regions; > + } > =20 > thunder_i2c_clock_enable(dev, i2c); > ret =3D device_property_read_u32(dev, "clock-frequency", &i2c->twsi_fre= q); > @@ -189,16 +191,16 @@ static int thunder_i2c_probe_pci(struct pci_dev *pd= ev, > =20 > ret =3D pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSIX); > if (ret < 0) > - goto error; > + goto error_disable_clock; > =20 > ret =3D devm_request_irq(dev, pci_irq_vector(pdev, 0), octeon_i2c_isr, = 0, > DRV_NAME, i2c); > if (ret) > - goto error; > + goto error_disable_clock; > =20 > ret =3D octeon_i2c_init_lowlevel(i2c); > if (ret) > - goto error; > + goto error_disable_clock; > =20 > octeon_i2c_set_clock(i2c); > =20 > @@ -214,7 +216,7 @@ static int thunder_i2c_probe_pci(struct pci_dev *pdev, > =20 > ret =3D i2c_add_adapter(&i2c->adap); > if (ret) > - goto error; > + goto error_disable_clock; > =20 > dev_info(i2c->dev, "Probed. Set system clock to %u\n", i2c->sys_freq); > =20 > @@ -224,8 +226,10 @@ static int thunder_i2c_probe_pci(struct pci_dev *pde= v, > =20 > return 0; > =20 > -error: > +error_disable_clock: > thunder_i2c_clock_disable(dev, i2c->clk); > +error_release_regions: > + pci_release_regions(pdev); > return ret; > } > =20 > @@ -236,6 +240,7 @@ static void thunder_i2c_remove_pci(struct pci_dev *pd= ev) > thunder_i2c_smbus_remove(i2c); > thunder_i2c_clock_disable(&pdev->dev, i2c->clk); > i2c_del_adapter(&i2c->adap); > + pci_release_regions(pdev); > } > =20 > static const struct pci_device_id thunder_i2c_pci_id_table[] =3D { > --=20 > 2.24.0 >=20 --n/aVsWSeQ4JHkrmm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAl53i6gACgkQFA3kzBSg Kbak5BAAoEmoF7vf0DlvwMvEh2XuDo71I8d3Zmetn9FCGVpebdlyzdWFnsfCHqDu bYztVMExdM32UGRLOzROtmbN7/Y7dLSmWZ301NrI9lStFnuMKPwTAbR0vZn8KAee QLDSC5MkF8fl7eisQ+PwTqfF34pOTBljEOYijiV+0QGObjlF5Xy8mB/DOyGwnwhX 0MKbdMXihTZRYDe2AOnBY78LARy10eZlClVnmDMCNqBJC4dZjRXCawspwzlIeywE s0eyokf0799Fy2Vwsqc3Ebvk6WUpDudLKo54BvnnsJcXfN440vDSoW5P8xbI6HsR w4Cq29lNd94u3kGMxjdg3LMaqDxf90fAhkDKRCFxJY4BzNChTSmgSUD2UbRGKGHQ 9gGqWmGSRx1qqrog0zolPhGP1s6fULoIkyqLYVH5fMLQbbJUGcxFNj3OAGuOJ5Q9 rfd2+lDA3tdQw/0NncOeB3Qr6VeGlQTUGv5clFhSXsxCVOdVX0T2FDJuJHP3Z1pe 8upjPoKeIlXs3Z9fsJIO1OOWvT2K+nvVLkbE56OVXwXqJONa9CdKtk2tTiWm4s4o K8DL7FVMOIqJ7mOw8j5u4x+wEwAPanWlBUVOPbTrAXPbmrsSQSQFX/srF/XcGuWb 9BALH6uiD51Pfst3kjIpkQ/829zhxg7efY6wFEPbK1Ptus7+hn8= =ZCWF -----END PGP SIGNATURE----- --n/aVsWSeQ4JHkrmm--