From patchwork Wed Jan 20 14:37:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pan Bian X-Patchwork-Id: 12032527 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=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 A831DC433DB for ; Wed, 20 Jan 2021 14:41:55 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 2885823356 for ; Wed, 20 Jan 2021 14:41:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2885823356 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=163.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=VjfqWq2qVzkaOZcDgQ9dGn53oelNxfFkdV99Qh7ILfg=; b=fHVX+aIXROMzM2f6ElzV1rmTfw 8MckxKfFvYJOK+N2PcWjkIDmfed+rZ2zKXKmyQ7XqpHxsHA9iVLHtaMR0NndN1hZjiVhA52pmQVUc fN2gybZbGr+ebmjTvnOqxDgkQebRKVLXTceO0tXqq4s0PF9d1pDcFvLoI+WMen3/qd9ECzEkr5JfE s4l2QilhHC8ef/fQrLa40pAZ+8P4ul3PbVja8ckE9CXUYZVaNmGDt4BItlreDCofeFqT7LpDh3MpR UdjTqIJKFwkeOlMXsJnqfyPGzV3dSCTU6KwyQGCsAA95DcaUN66rLiGHN7eiXtsawO4DwB9M8IGMn yQ3oLPqQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2EeR-0007h3-Kl; Wed, 20 Jan 2021 14:40:03 +0000 Received: from m12-12.163.com ([220.181.12.12]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2Ee0-0007NW-9y for linux-arm-kernel@lists.infradead.org; Wed, 20 Jan 2021 14:39:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=y8Z+jU1IE/vKH8MMhw F/F1/xZhIIlIreDEVa8fPEHRM=; b=n8biHLN1jMTnSd/CT269uO2McS1u8rKODW klv1XG5VUTGPFf7hk6Jwg3YQk777iOca3vrtmwfV7aKD7ISjceCaM20Fd+LUMeao 3ilKmtOBcjmxuxF7Dyqd/t7H5D8BFCa3rQIY3vYffAhWL7bEZZMQRjHujkDhPbA1 +PAL0afpI= Received: from localhost.localdomain (unknown [111.201.134.89]) by smtp8 (Coremail) with SMTP id DMCowAC3Nvs7QAhgoibuMw--.3261S4; Wed, 20 Jan 2021 22:37:50 +0800 (CST) From: Pan Bian To: Lorenzo Pieralisi , Rob Herring , Bjorn Helgaas , Michal Simek , Bharat Kumar Gogada Subject: [PATCH] PCI: xilinx-cpm: Fix reference count leak on error path Date: Wed, 20 Jan 2021 06:37:45 -0800 Message-Id: <20210120143745.699-1-bianpan2016@163.com> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: DMCowAC3Nvs7QAhgoibuMw--.3261S4 X-Coremail-Antispam: 1Uf129KBjvdXoW7JF15uFWUZF4ruw1rAw1DJrb_yoW3urX_uw 1UZF1xur4UCryfJr1vyrWSvr9Yyas7Xwn7KFn3tF13Aa9FgryfZr97A398XryrCrWfJF9r Ar90yay7CFyUCjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUjYiiPUUUUU== X-Originating-IP: [111.201.134.89] X-CM-SenderInfo: held01tdqsiiqw6rljoofrz/xtbBzx4gclaD9ynmfAAAsS X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210120_093959_157010_31D4C28B X-CRM114-Status: UNSURE ( 9.85 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-pci@vger.kernel.org, Pan Bian , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Also drop the reference count of the node on error path. Fixes: 508f610648b9 ("PCI: xilinx-cpm: Add Versal CPM Root Port driver") Signed-off-by: Pan Bian --- drivers/pci/controller/pcie-xilinx-cpm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pci/controller/pcie-xilinx-cpm.c b/drivers/pci/controller/pcie-xilinx-cpm.c index f92e0152e65e..67937facd90c 100644 --- a/drivers/pci/controller/pcie-xilinx-cpm.c +++ b/drivers/pci/controller/pcie-xilinx-cpm.c @@ -404,6 +404,7 @@ static int xilinx_cpm_pcie_init_irq_domain(struct xilinx_cpm_pcie_port *port) return 0; out: xilinx_cpm_free_irq_domains(port); + of_node_put(pcie_intc_node); dev_err(dev, "Failed to allocate IRQ domains\n"); return -ENOMEM;