From patchwork Thu Jun 14 09:04:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Mc Guire X-Patchwork-Id: 10463699 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1016F60532 for ; Thu, 14 Jun 2018 09:05:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F219728A1A for ; Thu, 14 Jun 2018 09:05:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5B8228A22; Thu, 14 Jun 2018 09:05:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 732EC28A09 for ; Thu, 14 Jun 2018 09:05:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.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=f1DZ2IqbtxUEIvXNXMBYtnxqkV2/DAN5g9N+UmVFu7o=; b=LUT dd4SI8PfIIVmMrFFhwen9ErjXxtx7zumHDkSQVIAuvp3wlaRze1zj0JCdjN5ralOuqE9sHi41ThG5 6crGyN4GtLWJ0W7cIxjYctpuARd3yUk0tb5/tp9juqiQhoWSgEu0it6e+EpA5Q3JUOEGqaeANb8BN jm/M4KmW/rLsAC/6NZZD2KPkucCP8aF/E3X1VzpdcTWos82KTD6MYHlb8nKIZAxk4Gc7yRxfxksge 8Ur5WPP2p/3yb4xlkTS/lwrYSIaz0q0HUEO7zsH0uIStZARAKpR8XokDKig1Ak1bwq3AA8uZwDtR3 iYJI0HR+43FMmWy6YnnYw0tHAnGh0WQ==; 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 1fTOC7-0005GO-Rj; Thu, 14 Jun 2018 09:05:27 +0000 Received: from www.osadl.org ([2001:a60:9266:ffff:62:245:132:105]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fTOC3-0003nR-7f for linux-arm-kernel@lists.infradead.org; Thu, 14 Jun 2018 09:05:25 +0000 Received: from debian01.hofrr.at (178.115.242.59.static.drei.at [178.115.242.59] (may be forged)) by www.osadl.org (8.13.8/8.13.8/OSADL-2007092901) with ESMTP id w5E94mHE023428; Thu, 14 Jun 2018 11:04:48 +0200 From: Nicholas Mc Guire To: Lorenzo Pieralisi Subject: [PATCH] PCI: xilinx-nwl: add missing of_node_put() Date: Thu, 14 Jun 2018 11:04:34 +0200 Message-Id: <1528967074-30024-1-git-send-email-hofrat@osadl.org> X-Mailer: git-send-email 2.1.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180614_020523_586025_A766C0DA X-CRM114-Status: GOOD ( 10.02 ) 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, Michal Simek , linux-kernel@vger.kernel.org, Nicholas Mc Guire , Bjorn Helgaas , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The call to of_get_next_child() returns a node pointer with refcount incremented thus it must be explicitly decremented here after the last usage. Signed-off-by: Nicholas Mc Guire Fixes: commit ab597d35ef11 ("PCI: xilinx-nwl: Add support for Xilinx NWL PCIe Host Controller") --- Problem found by an experimental cocinelle script Patch was compile tested with: multi_v7_defconfig + ARCH_ZYNQ=y, COMPILE_TEST=y, PCIE_XILINX_NWL=y (one sparse warning though not related to the change proposed though) Patch is against 4.17.0 (localversion-next is next-20180613) drivers/pci/controller/pcie-xilinx-nwl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/controller/pcie-xilinx-nwl.c b/drivers/pci/controller/pcie-xilinx-nwl.c index 6a4bbb5..fb32840 100644 --- a/drivers/pci/controller/pcie-xilinx-nwl.c +++ b/drivers/pci/controller/pcie-xilinx-nwl.c @@ -559,7 +559,7 @@ static int nwl_pcie_init_irq_domain(struct nwl_pcie *pcie) PCI_NUM_INTX, &legacy_domain_ops, pcie); - + of_node_put(legacy_intc_node); if (!pcie->legacy_irq_domain) { dev_err(dev, "failed to create IRQ domain\n"); return -ENOMEM;