From patchwork Mon Oct 17 14:59:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9379549 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 4CB9A607D4 for ; Mon, 17 Oct 2016 15:01:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E2EA290DB for ; Mon, 17 Oct 2016 15:01:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 32B2B29228; Mon, 17 Oct 2016 15:01:26 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C1652290DB for ; Mon, 17 Oct 2016 15:01:25 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bw9OO-00032k-Gv; Mon, 17 Oct 2016 14:59:56 +0000 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bw9O3-0002dk-F3 for linux-arm-kernel@lists.infradead.org; Mon, 17 Oct 2016 14:59:39 +0000 Received: by mail-pf0-x243.google.com with SMTP id r16so12946608pfg.3 for ; Mon, 17 Oct 2016 07:59:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zG244gc/PHJxRRs/Du0vjefGyzfEgSH+OejlFQxYDnQ=; b=rybMTConIHB/d2QU55ERupg6EX/H5JdhqTPpbYpBVodx5bta9jxqSdM/nA145oEa8Q P8nxevnRGJRy8Aie9bha1awaA716o47K0xiCv7HNTRdog9BTET4IkH71L+LqDvutavkG t1f8Zs69IK+8rpR5LsOAQ3GCwugere7rqMOr1707TLjrffpKwevit179bwmeIDohPxYR VZaeNtB2Grw7JashbroQPJ/rXIV1H03S2UzWTnUqOeZydfnOIGs9Mikyjt+WbujNVTyd /GPi5pjeXunoWuw4TY70ZZv4YeTVOygHWvJe8iYJ4E2LJuQ0odKgAckE9K1dItb8yrCX GtJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zG244gc/PHJxRRs/Du0vjefGyzfEgSH+OejlFQxYDnQ=; b=IHf4gRzd5wX6fq9+eyRG3lybJ4v3Yqn50Ez8d/vvKZamAdVwaaDUexKrzlsetMHRZ2 gwOJrAtE/m5i8T7eBVlvUaL+oBS1wgcps5xDmQU6p1zfYyOkXhI7vigCZhqYKiKzjnEA qWIXqSNyIce01N2uZeTBlMVtz1SeYAZloAPG+JVNj/cu91vormOBZ4wIMwA14qbLJ4EE WyzUhFeV2GVmKCF/88hwVlbCFQJXftXfT7JT5wfh3w2UD6eeefegUEviwrEnChXUoVWW gVOP0O5apFO/4gFb//9zvLQWggZ7HwOLizO0h2HEie+CNvWwF/egoZN5iHx7u20KAq0f FNig== X-Gm-Message-State: AA6/9RmC0re74ewiNMyxC/ukzMoZjS1k4+ozEEEq8bzMuGXEAumaGOKT9RQ4c9in9qxuaQ== X-Received: by 10.98.7.83 with SMTP id b80mr24084436pfd.181.1476716354558; Mon, 17 Oct 2016 07:59:14 -0700 (PDT) Received: from 192.168.0.37 (ec2-52-192-197-227.ap-northeast-1.compute.amazonaws.com. [52.192.197.227]) by smtp.gmail.com with ESMTPSA id e191sm48853179pfc.36.2016.10.17.07.59.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Oct 2016 07:59:13 -0700 (PDT) From: Wei Yongjun To: bhelgaas@google.com, michal.simek@xilinx.com, soren.brinkmann@xilinx.com, po.liu@nxp.com, christophe.jaillet@wanadoo.fr, paul.gortmaker@windriver.com, bharat.kumar.gogada@xilinx.com, rgummal@xilinx.com, arnd@arndb.de Subject: [PATCH -next] PCI: xilinx: Add missing of_node_put() in xilinx_pcie_init_irq_domain() Date: Mon, 17 Oct 2016 14:59:04 +0000 Message-Id: <1476716344-1050-1-git-send-email-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161017_075936_012569_CF240092 X-CRM114-Status: GOOD ( 10.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-pci@vger.kernel.org, Wei Yongjun , linux-arm-kernel@lists.infradead.org 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 From: Wei Yongjun This node pointer is returned by of_get_next_child() with refcount incremented in this function. of_node_put() on it before exitting this function on error. This is detected by Coccinelle semantic patch. Signed-off-by: Wei Yongjun --- drivers/pci/host/pcie-xilinx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pci/host/pcie-xilinx.c b/drivers/pci/host/pcie-xilinx.c index c8616fa..7100ee5 100644 --- a/drivers/pci/host/pcie-xilinx.c +++ b/drivers/pci/host/pcie-xilinx.c @@ -529,6 +529,7 @@ static int xilinx_pcie_init_irq_domain(struct xilinx_pcie_port *port) port); if (!port->leg_domain) { dev_err(dev, "Failed to get a INTx IRQ domain\n"); + of_node_put(pcie_intc_node); return -ENODEV; } @@ -540,6 +541,7 @@ static int xilinx_pcie_init_irq_domain(struct xilinx_pcie_port *port) &xilinx_pcie_msi_chip); if (!port->msi_domain) { dev_err(dev, "Failed to get a MSI IRQ domain\n"); + of_node_put(pcie_intc_node); return -ENODEV; }