From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [PATCH v2] PCI: tegra: add missing cleanup in error path and teardown_irq Date: Mon, 28 Jul 2014 17:35:50 +0200 Message-ID: <20140728153548.GB10126@ulmo.nvidia.com> References: <1406519142-3018-1-git-send-email-jszhang@marvell.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Yylu36WmvOXNoKYn" Return-path: Content-Disposition: inline In-Reply-To: <1406519142-3018-1-git-send-email-jszhang-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org> Sender: linux-tegra-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Jisheng Zhang Cc: bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org, swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-tegra@vger.kernel.org --Yylu36WmvOXNoKYn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 28, 2014 at 11:45:42AM +0800, Jisheng Zhang wrote: > We should call tegra_msi_free() to free the msi bit if > irq_create_mapping() fails. And we need to dispose the irq mapping > during irq teardown. "MSI" and "IRQ" please. > diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c > index 083cf37..4ccc418 100644 > --- a/drivers/pci/host/pci-tegra.c > +++ b/drivers/pci/host/pci-tegra.c > @@ -1203,8 +1203,10 @@ static int tegra_msi_setup_irq(struct msi_chip *ch= ip, struct pci_dev *pdev, > return hwirq; > =20 > irq =3D irq_create_mapping(msi->domain, hwirq); > - if (!irq) > + if (!irq) { > + tegra_msi_free(msi, hwirq); > return -EINVAL; > + } > =20 > irq_set_msi_desc(irq, desc); > =20 > @@ -1222,8 +1224,10 @@ static void tegra_msi_teardown_irq(struct msi_chip= *chip, unsigned int irq) > { > struct tegra_msi *msi =3D to_tegra_msi(chip); > struct irq_data *d =3D irq_get_irq_data(irq); > + unsigned long hwirq =3D d->hwirq; I don't think we need this temporary variable, d->hwirq isn't overly long. With both of the above address, this is: Reviewed-by: Thierry Reding Acked-by: Thierry Reding --Yylu36WmvOXNoKYn Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJT1m3UAAoJEN0jrNd/PrOhZasQALoR5knIFNMBrM3nd3VDbiBM whzllsWhurlCryKp0VmgKc6+K6gYhMBIlBjMAcFB19bqEiANnmfHibB6xOSiqPeA UkmCrj7OYHLIkNlL2OHBtusqbkLkQJHzsspif7sGJn8OB68PaSn/FT3V3mtB7q9O zUQTZP4NQ+6IwFGpf3+BBAjdht5yDv79QiYClSedfEIlX4GNEw8x0uH74lW+f80d nO1CDNrHqPLUxjBxoWe5G0gTaNX71xILbJVTLg/536/9SOIQb40GhsrKluJBWleQ SM35SSiV3Khd+3WTSBe8gEwjJnr4p68WI25KQx2koS6SrwlLJYZms6hqm/wKxbIK uBhT13zAZ4QFf4BiAQzF5Lfhlupuq+QA/vk7YvYzv8sFta3sgby52xjk9o7lJfJy kwnP8JsYOlw1fUIOOGmlZlKPOoDpI7NKwkpMoZlGMTUAIbrt39bSvfKIZJMlnx+I PaYChbeOXQmM/mF6+5u5lIFyyieRK/Iks52UbiClUrvI7Lv5xKzz/uoNPZyQdhea AYMel5Y56FV/ZV1V67BQ9eA/noAUUICgGiRtLukzPhhUeplOp0fglnUwg+S2M7Em DOqdwLCl/58PqDNLqMA8tQ6YDGKI8Nz5DOfbAqQhsUKHF36YRROemYSuLpgp+zSo QJHcvlT+y5+O8/AaBQ+Z =cEjM -----END PGP SIGNATURE----- --Yylu36WmvOXNoKYn--