Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp1369826img; Tue, 26 Feb 2019 20:41:32 -0800 (PST) X-Google-Smtp-Source: AHgI3IaUiFawjufb8OnjIYaJoSYH1V6U9tTIxGg0r+B7svqYrOBPyOzyIVAdJqMrlvTv+LSq2q31 X-Received: by 2002:a17:902:c81:: with SMTP id 1mr126338plt.155.1551242492595; Tue, 26 Feb 2019 20:41:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551242492; cv=none; d=google.com; s=arc-20160816; b=fDlzdXaraX+AFWZ7bo7Si6qkY2QvDNg+8ZAjHTZ8qzhKwpI4SDeehH4QoX0heSuR4/ pnF/Va/czblckGQPpoD3oeIJKDawmHk07OXl7WfYKPFwPMSe533NR/6Gn9HWoVRSOqdK tLMEY2hK5RiS8x6ZkHZKtFh6HJtSDwiJm2Y+P/SY40B16L0AnqgQAZ3/X91LxUGxPbus k9jXfZ5FbTXUGwgtL7X9n2vpqFUAYEPsZlQG2vMUV3w6nd8aKdzQsQzGid9HLHDqgeJ4 Z6qaI/2zyxRyESlg/KChZdHWHsHxHtDaGN1KCubW/Zo90uUzmUPF+961qbQxw7FSUb7q ve2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=GMBKxx65tsTtO8DxVu4Bj26loXMuhkeRnvfI3O88XFc=; b=jvmS1ikONRxnvNqjY9dNjFGnjgPDRf4o0aHlhivU9prIGdBnXbJugOSYDsxxkT0Dh9 xghpxPjwTZ7FlQB1U8QN9WkfIQcK3A7TpNDnDiH4rhs9i1ZlUzvIM3uQUoedMyDg07o7 5SbuPSpMuj1Tze6ZgHFhmF4tY2kI29w7G+FMGguWgvtjdtjEnh32zuNMdo4Z1JgUqFQA tLy5ZUeAT0kf+WaDQrvkuq45pJlo5aDRQzemQ668FvzU2MPw6Hmhxhh+8Gu0UeP3+8AS mUQw6z2hRfJ7pAwHBtE/q9bo36W6EZNGud2NVSPj0Iy31PVU6S/z+3r5CK9jSvlAirtt Y/QA== 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 v25si14853133pfg.135.2019.02.26.20.41.17; Tue, 26 Feb 2019 20:41:32 -0800 (PST) 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 S1729616AbfB0Eku (ORCPT + 99 others); Tue, 26 Feb 2019 23:40:50 -0500 Received: from mxhk.zte.com.cn ([63.217.80.70]:27070 "EHLO mxhk.zte.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729265AbfB0Ekt (ORCPT ); Tue, 26 Feb 2019 23:40:49 -0500 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id 5D10086307C4E05DC5FE; Wed, 27 Feb 2019 12:40:46 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id x1R4eduq003660; Wed, 27 Feb 2019 12:40:39 +0800 (GMT-8) (envelope-from wen.yang99@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2019022712405994-2029110 ; Wed, 27 Feb 2019 12:40:59 +0800 From: Wen Yang To: benh@kernel.crashing.org Cc: 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, lorenzo.pieralisi@arm.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, Wen Yang Subject: [PATCH 3/8] PCI: dwc: layerscape: fix a leaked reference by adding missing of_node_put Date: Wed, 27 Feb 2019 12:40:38 +0800 Message-Id: <1551242443-27300-3-git-send-email-wen.yang99@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1551242443-27300-1-git-send-email-wen.yang99@zte.com.cn> References: <1551242443-27300-1-git-send-email-wen.yang99@zte.com.cn> X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2019-02-27 12:41:00, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-02-27 12:40:31, Serialize complete at 2019-02-27 12:40:31 X-MAIL: mse01.zte.com.cn x1R4eduq003660 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The call to of_parse_phandle returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. Detected by coccinelle with the following warnings: ./drivers/pci/controller/dwc/pci-layerscape.c:204:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 198, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Minghuan Lian Cc: Mingkai Hu Cc: Roy Zang Cc: Lorenzo Pieralisi Cc: Bjorn Helgaas Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-pci@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- drivers/pci/controller/dwc/pci-layerscape.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pci/controller/dwc/pci-layerscape.c b/drivers/pci/controller/dwc/pci-layerscape.c index ce45bde2..3a5fa26 100644 --- a/drivers/pci/controller/dwc/pci-layerscape.c +++ b/drivers/pci/controller/dwc/pci-layerscape.c @@ -201,6 +201,7 @@ static int ls_pcie_msi_host_init(struct pcie_port *pp) return -EINVAL; } + of_node_put(msi_node); return 0; } -- 2.9.5