From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f195.google.com ([209.85.128.195]:33130 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753306AbeEVXUP (ORCPT ); Tue, 22 May 2018 19:20:15 -0400 Subject: Re: [PATCH 3/4] PCI: rcar: Add missing irq_dispose_mapping() into failpath To: Geert Uytterhoeven Cc: linux-pci , Marek Vasut , Geert Uytterhoeven , Phil Edworthy , Simon Horman , Wolfram Sang , Linux-Renesas References: <20180521131123.2009-1-marek.vasut+renesas@gmail.com> <20180521131123.2009-3-marek.vasut+renesas@gmail.com> From: Marek Vasut Message-ID: Date: Tue, 22 May 2018 23:51:09 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Sender: linux-pci-owner@vger.kernel.org List-ID: On 05/22/2018 05:18 PM, Geert Uytterhoeven wrote: > Hi Marek, Hi, > On Mon, May 21, 2018 at 3:11 PM, Marek Vasut wrote: >> The rcar_pcie_get_resources() is another misnomer with a side effect. >> The function does not only get resources, but also maps MSI IRQs via >> irq_of_parse_and_map(). In case anything fails afterward, the IRQ >> mapping must be disposed through irq_dispose_mapping() which is not >> done. >> >> This patch handles irq_of_parse_and_map() failures in by disposing >> of the mapping in rcar_pcie_get_resources() as well as in probe. >> >> Signed-off-by: Marek Vasut > > Reviewed-by: Geert Uytterhoeven > >> --- a/drivers/pci/host/pcie-rcar.c >> +++ b/drivers/pci/host/pcie-rcar.c >> @@ -923,18 +923,25 @@ static int rcar_pcie_get_resources(struct rcar_pcie *pcie) >> i = irq_of_parse_and_map(dev->of_node, 0); >> if (!i) { >> dev_err(dev, "cannot get platform resources for msi interrupt\n"); >> - return -ENOENT; >> + err = -ENOENT; >> + goto err_irq1; > > You could have kept the return here. I like the symmetry ;-) [...] -- Best regards, Marek Vasut