Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp120149yba; Mon, 1 Apr 2019 03:04:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+6A09Y5DxKt9evO03qeunk/jlZg4jcTW1EFLSDT6/HDy3qy10XgO9bioOuuUVfkBrqbT0 X-Received: by 2002:a63:5a1d:: with SMTP id o29mr55548733pgb.320.1554113067213; Mon, 01 Apr 2019 03:04:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554113067; cv=none; d=google.com; s=arc-20160816; b=Nknp8gRweTCW1oNsCcJnmg9vKFGe3ppghOiMaZum7AuLOCqctuHnH8RWeRxUYzBGal CM4BMwNfYyUT6fvNloJpsrk3OpBbzAxUFFidLR7yDKg/8Rld/A4HbS9nfK1RD03AIbwr f7X+H0xOOA4J0CKQxWc+QRHWyT+2LU0lsRUOwbfkq3M0DqwzCq1XROGhgP18g0PKhI6b 1mK/CF38XiUO4ozK2D/y7oFTtHGomILIrY9baArfvCp2Fb/mfpeJuhZ5KD9/Qt/A8/AP BitIvnfFlMaiwcXlHZkH0/9P6b7sZ9K8CVulNV8hpdebjC40TBNIpGYV8H0otUEhwfcj zaug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=gzs6L//ya5adRFV+lpfzS//qO4q5GtPmW6eEnNVCxQw=; b=ISRgpBJT1F/ZwyYkD6I0ondVpgSzFG/1C+UZyzsRtWHknydV7UpSbuNvw2LWu/tIsD jjFvspdw2mca9UkuYEvPzrIOAaPiBtnfxs1n6qVJrNC9ol6bo8lGbTHaUzKu6ikq1XE7 JErMcovr4Zchx23+XXlU9oRL3X3GoW3wF5vIOG7O8T83L0zj2xPmbWN8wPr88fZzPEFF laaLp4vpuOPp28UkKusxGKACT7WB9ra/Vy+mdMQHVBFe2dAeSgN2HDVCzx2ZNXzMXs6K lsrtY/u4SWxtegNHd4A/U6ppGWzZjvrZ9Ikfg9ASoLCfvOMMHVKq8IXVv7pNQTfrZw6t 5ZWw== 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 y5si8533136plp.192.2019.04.01.03.04.11; Mon, 01 Apr 2019 03:04:27 -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 S1726399AbfDAKD1 (ORCPT + 99 others); Mon, 1 Apr 2019 06:03:27 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:59782 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725868AbfDAKD1 (ORCPT ); Mon, 1 Apr 2019 06:03:27 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7F7E6A78; Mon, 1 Apr 2019 03:03:26 -0700 (PDT) Received: from e107981-ln.cambridge.arm.com (e107981-ln.cambridge.arm.com [10.1.197.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CCC163F690; Mon, 1 Apr 2019 03:03:21 -0700 (PDT) Date: Mon, 1 Apr 2019 11:03:18 +0100 From: Lorenzo Pieralisi To: Wen Yang Cc: benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au, tyreld@linux.vnet.ibm.com, bhelgaas@google.com, linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, ryder.lee@mediatek.com, matthias.bgg@gmail.com, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, rjui@broadcom.com, sbranden@broadcom.com, bcm-kernel-feedback-list@broadcom.com, thomas.petazzoni@bootlin.com, shawn.lin@rock-chips.com, heiko@sntech.de, linux-rockchip@lists.infradead.org, minghuan.Lian@nxp.com, mingkai.hu@nxp.com, roy.zang@nxp.com, hayashi.kunihiko@socionext.com, yamada.masahiro@socionext.com, kishon@ti.com, linux-omap@vger.kernel.org, wang.yi59@zte.com.cn Subject: Re: [PATCH 1/8] PCI: dwc: pci-dra7xx: fix a leaked reference by adding missing of_node_put Message-ID: <20190401100318.GB30501@e107981-ln.cambridge.arm.com> References: <1551242443-27300-1-git-send-email-wen.yang99@zte.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1551242443-27300-1-git-send-email-wen.yang99@zte.com.cn> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 27, 2019 at 12:40:36PM +0800, Wen Yang wrote: > The call to of_get_next_child returns a node pointer with refcount > incremented thus it must be explicitly decremented after the last > usage. > irq_domain_add_linear also calls of_node_get to increase refcount, > so irq_domain will not be affected when it is released. > > Detected by coccinelle with the following warnings: > ./drivers/pci/controller/dwc/pci-dra7xx.c:252:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 241, but without a corresponding object release within this function. > ./drivers/pci/controller/dwc/pci-dra7xx.c:255:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 241, but without a corresponding object release within this function. > > Signed-off-by: Wen Yang > Cc: Kishon Vijay Abraham I > Cc: Lorenzo Pieralisi > Cc: Bjorn Helgaas > Cc: linux-omap@vger.kernel.org > Cc: linux-pci@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > --- > drivers/pci/controller/dwc/pci-dra7xx.c | 1 + > 1 file changed, 1 insertion(+) Applied the series to pci/misc for v5.2, thanks. Lorenzo > diff --git a/drivers/pci/controller/dwc/pci-dra7xx.c b/drivers/pci/controller/dwc/pci-dra7xx.c > index ae84a69..627c91d 100644 > --- a/drivers/pci/controller/dwc/pci-dra7xx.c > +++ b/drivers/pci/controller/dwc/pci-dra7xx.c > @@ -247,6 +247,7 @@ static int dra7xx_pcie_init_irq_domain(struct pcie_port *pp) > > dra7xx->irq_domain = irq_domain_add_linear(pcie_intc_node, PCI_NUM_INTX, > &intx_domain_ops, pp); > + of_node_put(pcie_intc_node); > if (!dra7xx->irq_domain) { > dev_err(dev, "Failed to get a INTx IRQ domain\n"); > return -ENODEV; > -- > 2.9.5 >