Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp2048257imm; Sat, 23 Jun 2018 08:18:22 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJHOWzwsEUBy65LOxh06sQ3K3FswgAS4Wi3NgFvf3T0Vs95xhyF64XQLe4TW95HiJsSxckx X-Received: by 2002:a17:902:6686:: with SMTP id e6-v6mr5924443plk.35.1529767102682; Sat, 23 Jun 2018 08:18:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529767102; cv=none; d=google.com; s=arc-20160816; b=of3gIMAh9t/dhedh9wYYa48Xl35zyTH3gOZAgJJ2zG01GYB2Ysj/z7J7lLwTHPtlv7 itG8A8+V/iNgL4S+d692wvXm/IOHwz2KFHiYHV3xCCbn1Bn5qniCJt8U3eJ7Tyf0s34A nS6nDeMId1/NcvY6OdGvfI6Gt6iFuN8W9De3KVGawNoDyU/TsmzFo3B9oDlh0uMF3ikw MNmcXij0k9pqYkt9hugDsHa+k7S+h2YqQWN07+NiXWHRkJjeQRUbh5kWy/gAC4qMf9Xl vuC+ULubeAN4Mm+w7p4BtGB7SUSjSOZfi75w0BA+mrSXRmoQMr59O/raBtQ4h5MYaQEo iByQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=HdQod44jOE6NMZuK94+1vzz6REnMfmE5mLXQlYoqPN4=; b=eqZPY5M2xDZ+LtKQLLNCVfX5jI3mh9zwcVOah57c+k6Ljx1kB0aVyPfulPpVUZBfxW 0njdD/N+lh2plbfCGxjjEwJtPoxovfeo5gA7oJ2dHyth9JEB7hZWGWCwCqd8/liE/UMw Vj+5MWaCl+iOtD5/uU3pbelxD6wL/I4Pi9AuMFaSHaEo1pEiepUrMkwAgvo9zdpeAKxE KrfyxViBO2pBs/gnfqw/0YdSZxeq7O1kUmmCsknIzwFqeCXSmhUC+FN8wIAStKHdlyj4 ZBeRKXOySUKTmQ5I09wMRlVMG2XmUbR7K3iZc/IrwphhHzHHD9aOzdlh9wwoIaLS++UD LLnw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r8-v6si10970886plj.40.2018.06.23.08.17.54; Sat, 23 Jun 2018 08:18:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751771AbeFWPQm (ORCPT + 99 others); Sat, 23 Jun 2018 11:16:42 -0400 Received: from www.osadl.org ([62.245.132.105]:39539 "EHLO www.osadl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751471AbeFWPQl (ORCPT ); Sat, 23 Jun 2018 11:16:41 -0400 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 w5NFFUWd027117; Sat, 23 Jun 2018 17:15:30 +0200 From: Nicholas Mc Guire To: Linus Walleij Cc: Lorenzo Pieralisi , Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Nicholas Mc Guire Subject: [PATCH] PCI: faraday: add missing of_node_put() Date: Sat, 23 Jun 2018 17:14:59 +0200 Message-Id: <1529766899-1994-1-git-send-email-hofrat@osadl.org> X-Mailer: git-send-email 2.1.4 X-Spam-Status: No, score=-4.2 required=6.0 tests=BAYES_00,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on www.osadl.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The call to of_get_next_child() returns a node pointer with refcount incremented thus it must be explicitly decremented here in the error path and after the last usage. Signed-off-by: Nicholas Mc Guire Fixes: commit d3c68e0a7e34 ("PCI: faraday: Add Faraday Technology FTPCI100 PCI Host Bridge driver") --- Patch found my experimental coccinelle script Patch was compile tested with: gemini_defconfig (implies CONFIG_PCI_FTPCI100=y) Patch is against 4.18-rc1 (localversion-next is next-20180621) drivers/pci/controller/pci-ftpci100.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pci/controller/pci-ftpci100.c b/drivers/pci/controller/pci-ftpci100.c index a1ebe9e..20bb256 100644 --- a/drivers/pci/controller/pci-ftpci100.c +++ b/drivers/pci/controller/pci-ftpci100.c @@ -355,11 +355,13 @@ static int faraday_pci_setup_cascaded_irq(struct faraday_pci *p) irq = of_irq_get(intc, 0); if (irq <= 0) { dev_err(p->dev, "failed to get parent IRQ\n"); + of_node_put(intc); return irq ?: -EINVAL; } p->irqdomain = irq_domain_add_linear(intc, PCI_NUM_INTX, &faraday_pci_irqdomain_ops, p); + of_node_put(intc); if (!p->irqdomain) { dev_err(p->dev, "failed to create Gemini PCI IRQ domain\n"); return -EINVAL; -- 2.1.4