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: 9379541 X-Patchwork-Delegate: bhelgaas@google.com 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 7425A607D4 for ; Mon, 17 Oct 2016 14:59:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6283C29197 for ; Mon, 17 Oct 2016 14:59:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 53DCD292FC; Mon, 17 Oct 2016 14:59:35 +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=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E333829197 for ; Mon, 17 Oct 2016 14:59:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754734AbcJQO7T (ORCPT ); Mon, 17 Oct 2016 10:59:19 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:35006 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757588AbcJQO7P (ORCPT ); Mon, 17 Oct 2016 10:59:15 -0400 Received: by mail-pf0-f194.google.com with SMTP id s8so12933806pfj.2 for ; Mon, 17 Oct 2016 07:59:15 -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=THsATm4ub4AVhh8BKbU5i4+QNzRoCjIAtW5wmrKw7ZPuAUYnXjkPhdmzEPD9qQMiPx BAme4a3DjBrCpgKFerH/zMEZGq+TXP9j+M2RFZGOfBJdlUUWK7iU+3S74N0DNlh0wXat QCp71UX8Li9IOCTkwqpFA0BvAY8baxkc1inEh5ClNj0g3emLu6TxQw6oWbUXlnf35p8+ z0eVacbXYfsQJeXKC9fuuVMBz3fd8uWvQzep8P3ZdPLQnlMXQdVYOGQzA6HDo4MVQc3e aBD7V3DUAuebhda3vhxhrK635yI54/QUwzckpe4UXtUqkwYGr/zJAQ+vM35WkwLjMT78 2FUg== X-Gm-Message-State: AA6/9RnaTVaBN1hJL+8gR0WGjoXSle/TlcZiAUdXAMgOd66OUxAosqtQTZUKouUUeqiMrg== 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 Cc: Wei Yongjun , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.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(+) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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; }