From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27F62C43381 for ; Thu, 28 Mar 2019 17:08:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EE3152183F for ; Thu, 28 Mar 2019 17:08:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="TJ4t7mxw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EE3152183F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=igeWvoQ6Atl2lmKVCa30bywin8/NyYZ1jnbMYD5r9FM=; b=TJ4t7mxwtqismV9FpxDuxyx1d FzGdWU7SlO9cWoReSeE/i2ao9R9JY6pLKP1KR6FL83vczEzBdcrSrut8VJ35kqALzAAN1q5CAP7Tr nyl9l5ZPE/F0o/QANVC99wzV7J2Dv1LsWJZlgsMBmRwxj6lOz7de3TrEi3rM9AE7skUQw2Cycb9F1 gYrLf6z8VBvSU3aZY3pzNyvSNrAiNQsdOGDXnBsUNW8gApTlDTac+2uRuG/ptxG1Yo7eXwC1p2c3r SqBh2M8g9r/0scCoLd3aN/hW0MCeYnYE7xld0U8nTE5BfhnyaIKKTAARE2W4a4VoCpYUTH2njC3mh qSpj3YcMQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h9YWJ-0003Cg-0u; Thu, 28 Mar 2019 17:08:51 +0000 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h9YWG-0003Bj-1c for linux-arm-kernel@lists.infradead.org; Thu, 28 Mar 2019 17:08:49 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 31BFE80D; Thu, 28 Mar 2019 10:08:46 -0700 (PDT) Received: from [10.1.196.75] (e110467-lin.cambridge.arm.com [10.1.196.75]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C766A3F557; Thu, 28 Mar 2019 10:08:44 -0700 (PDT) Subject: Re: [PATCH v3 3/5] PCI: dwc: Free MSI in the error code path of dw_pcie_host_init() To: Jisheng Zhang , Jingoo Han , Gustavo Pimentel , Lorenzo Pieralisi , Bjorn Helgaas References: <20190318174415.74fd25a5@xhacker.debian> <20190318174841.522fb6fd@xhacker.debian> From: Robin Murphy Message-ID: <689f8a0f-ba79-da80-d0e3-24ef6814a9aa@arm.com> Date: Thu, 28 Mar 2019 17:08:43 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <20190318174841.522fb6fd@xhacker.debian> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190328_100848_096504_6A8D2700 X-CRM114-Status: GOOD ( 20.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 18/03/2019 09:56, Jisheng Zhang wrote: > If we ever did some msi related initializations, we need to call > dw_pcie_free_msi() in the error code path. > > Signed-off-by: Jisheng Zhang > Acked-by: Gustavo Pimentel > --- > drivers/pci/controller/dwc/pcie-designware-host.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c > index a71b874ae3c0..585080699675 100644 > --- a/drivers/pci/controller/dwc/pcie-designware-host.c > +++ b/drivers/pci/controller/dwc/pcie-designware-host.c > @@ -483,7 +483,7 @@ int dw_pcie_host_init(struct pcie_port *pp) > if (pp->ops->host_init) { > ret = pp->ops->host_init(pp); > if (ret) > - goto error; > + goto err_free_msi; > } > > pp->root_bus_nr = pp->busn->start; > @@ -497,7 +497,7 @@ int dw_pcie_host_init(struct pcie_port *pp) > > ret = pci_scan_root_bus_bridge(bridge); > if (ret) > - goto error; > + goto err_free_msi; > > bus = bridge->bus; > > @@ -513,6 +513,10 @@ int dw_pcie_host_init(struct pcie_port *pp) > pci_bus_add_devices(bus); > return 0; > > +err_free_msi: > + if (IS_ENABLED(CONFIG_PCI_MSI) && pci_msi_enabled() && pci_msi_enabled() already has a stub for !CONFIG_PCI_MSI, so you shouldn't need an explicit IS_ENABLED() here. Robin. > + !pp->ops->msi_host_init) > + dw_pcie_free_msi(pp); > error: > pci_free_host_bridge(bridge); > return ret; > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel