From patchwork Wed Jun 13 17:20:44 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: 10462723 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 63FCE60329 for ; Wed, 13 Jun 2018 17:21:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51B3128ED6 for ; Wed, 13 Jun 2018 17:21:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 465DE28F4D; Wed, 13 Jun 2018 17:21:42 +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 E1EEE28ED6 for ; Wed, 13 Jun 2018 17:21:41 +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=OUd+wbn066lSNdK0U3U45RPsxWTLBY6WsEyygXjbMfE=; b=Fgd Zs/OJpPxRu+WLQ7rYZGEXZ0eE7m6Wzx6birNF22XtQa77a717UeL8fpbbsBecwZUg3QXI1Ccfz4wP tgA7fytnIRRjSJOQl2PuKHRzxGzOnNMR+qHBK+S+GMSzZ0qvlGO5yeMhpNwcvjZ7ndCva8HVbpy7e EG79P+u+AaDcC1QXz653pUfEUH3uVPLMw3BRHWKkhyvyWVX1P90ZqoAaqISnVbk5vVZnynUk/g7Rz gIAc45vNREdPu3iM2sZYNwx+bz2woLDtIC3i24a0KX3i43JsI+jq42vNEipYTP1vbT20uAZyXHURt Dr4qBBVAAaGasgU7QSnoS2Al/picJWQ==; 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 1fT9Sg-0003L8-LN; Wed, 13 Jun 2018 17:21:34 +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 1fT9Sb-00039m-QA for linux-arm-kernel@lists.infradead.org; Wed, 13 Jun 2018 17:21:31 +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 w5DHKwCo009004; Wed, 13 Jun 2018 19:20:58 +0200 From: Nicholas Mc Guire To: Lorenzo Pieralisi Subject: [PATCH] PCI: xilinx: add missing of_node_put() Date: Wed, 13 Jun 2018 19:20:44 +0200 Message-Id: <1528910444-25593-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-20180613_102130_153080_3796F081 X-CRM114-Status: UNSURE ( 8.94 ) X-CRM114-Notice: Please train this message. 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 8961def56845 ("PCI: xilinx: Add Xilinx AXI PCIe Host Bridge IP driver") --- Problem found by an experimental cocinelle script Patch was compile tested with: multi_v7_defconfig + ARCH_ZYNQ=y, COMPILE_TEST=y, PCIE_XILINX=y (with one sparse warning though not related to the change proposed) Patch is against 4.17.0 (localversion-next is next-20180613) drivers/pci/controller/pcie-xilinx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pci/controller/pcie-xilinx.c b/drivers/pci/controller/pcie-xilinx.c index b110a3a..7b1389d 100644 --- a/drivers/pci/controller/pcie-xilinx.c +++ b/drivers/pci/controller/pcie-xilinx.c @@ -509,6 +509,7 @@ static int xilinx_pcie_init_irq_domain(struct xilinx_pcie_port *port) port->leg_domain = irq_domain_add_linear(pcie_intc_node, PCI_NUM_INTX, &intx_domain_ops, port); + of_node_put(pcie_intc_node); if (!port->leg_domain) { dev_err(dev, "Failed to get a INTx IRQ domain\n"); return -ENODEV;