Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp1370110img; Tue, 26 Feb 2019 20:42:03 -0800 (PST) X-Google-Smtp-Source: AHgI3IbXPXsVAReSWiDWCoSQ1gV7BdAL7Dqx35gF8DhDwgLAhXvgJrGRqFcUUTaGrFqF+3gvPpYX X-Received: by 2002:a63:5f0f:: with SMTP id t15mr1127524pgb.272.1551242522975; Tue, 26 Feb 2019 20:42:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551242522; cv=none; d=google.com; s=arc-20160816; b=i6RbxfN4h8/AK+rI+urn6c+A/wmlw+4vQzv9Xzdczge+uWIFz285NgZK6TFQdy2ICp WUvX4X2jhEl8E+5oxwyrm39UVUPq6Dn+Yr4W/5MWFFAMUxaYSJN6KwAIuULu88K4cfu0 Hzt4yfjdsQqKl/j5aRIYBwY9BJrjM2JQnmr7VceHwJq6mVjWi8HkNHtELT/nAvWuDtu2 VwOOBdtqGtW6jO8D3tE3u2X/QzVtI1bG0K06W+bIGZb1ei1LeBJSIosEESE3Cgc5yiCo TSozLJF53YzRdZjHQ4T8Pl1erO0DkUqiTxsPkTAv3NwMAhbEIXv0Zv9AdlhS9qvS/m+V MmGA== 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=8HQpO6KskiUU6iRobWx7e1xuWgQJJ1Infhb1yBVCl0E=; b=dwwKTpC3CiT1FAPSUsSdwQw8qJLMbU295GMwnNaCBHm82NhYpTk1Hv8eBimy9nQCjj 5iYxEGhahfHTsy8CDev9esP3s+D305MaWyVAaaoHljZX32/o2u0ra/+K3TuIiyEMcZ9R kuPt4PBIuRab6FzTeCR2Nr+8bvOMzDEoASpdMC/je3qkJ4158wqB4f5XryByBh+3Lshz 9RaSkkg/8LFI8SAuEozfgkgbZ7gYuhBIkVW4zg/rnsoRVjf4pgFUtZIMqhOK2xoy7/oA +tGy267nxoX4kSQxFrsBJ491GPLCZKo6F1Ef5gbT8X0qabvbwy0rcIsnyeSXu3GQuHxa /a1w== 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 o3si14091342pll.162.2019.02.26.20.41.48; Tue, 26 Feb 2019 20:42:02 -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 S1729843AbfB0ElL (ORCPT + 99 others); Tue, 26 Feb 2019 23:41:11 -0500 Received: from out1.zte.com.cn ([202.103.147.172]:33882 "EHLO mxct.zte.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729674AbfB0ElI (ORCPT ); Tue, 26 Feb 2019 23:41:08 -0500 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id 8E9CD2854E3034C164C2; Wed, 27 Feb 2019 12:41:05 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id x1R4etdZ003794; Wed, 27 Feb 2019 12:40:55 +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 2019022712411629-2029149 ; Wed, 27 Feb 2019 12:41:16 +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 8/8] PCI: rpadlpar: fix a leaked reference by adding missing of_node_put Date: Wed, 27 Feb 2019 12:40:43 +0800 Message-Id: <1551242443-27300-8-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:16, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-02-27 12:40:48, Serialize complete at 2019-02-27 12:40:48 X-MAIL: mse01.zte.com.cn x1R4etdZ003794 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The call to of_find_node_by_name 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/hotplug/rpadlpar_core.c:55:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 42, but without a corresponding object release within this function Signed-off-by: Wen Yang Cc: Tyrel Datwyler Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Bjorn Helgaas Cc: linux-pci@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org --- drivers/pci/hotplug/rpadlpar_core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c index e2356a9..f3f42ff 100644 --- a/drivers/pci/hotplug/rpadlpar_core.c +++ b/drivers/pci/hotplug/rpadlpar_core.c @@ -52,6 +52,7 @@ static struct device_node *find_vio_slot_node(char *drc_name) break; } + of_node_put(parent); return dn; } -- 2.9.5