Article View: linux.kernel.netdev
Article #13676[PATCH v2 net 1/4] net: ti: icssg-prueth: Fix device_node refcount leak in prueth_probe()
From: Xiangwu Lai
Date: Tue, 10 Nov 2026 06:41
Date: Tue, 10 Nov 2026 06:41
50 lines
10557 bytes
10557 bytes
prueth_probe() takes references on the eth0_node/eth1_node device nodes
with of_node_get() and stores them in prueth->eth_node[]. If either of
the "ti,mii-g-rt" or "ti,mii-rt" syscon regmap lookups fails, probe()
returns -ENODEV without dropping those references, leaking the device
nodes.
Jump to the existing put_cores label so the error path releases the
eth0_node/eth1_node references like all the other failure paths in the
function do.
Fixes: 128d5874c082 ("net: ti: icssg-prueth: Add ICSSG ethernet driver")
Signed-off-by: Xiangwu Lai <laixiangwu@cmss.chinamobile.com>
---
Changes in v2:
- Collect the two independent fixes into one series (suggested by
Simon Horman).
- No code change since v1.
Link: https://lore.kernel.org/netdev/20261030085651.1944-1-laixiangwu@cmss.chinamobile.com/
drivers/net/ethernet/ti/icssg/icssg_prueth.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth.c b/drivers/net/ethernet/ti/icssg/icssg_prueth.c
index 591be5c80..9b971d1df 100644
--- a/drivers/net/ethernet/ti/icssg/icssg_prueth.c
+++ b/drivers/net/ethernet/ti/icssg/icssg_prueth.c
@@ -2258,13 +2258,15 @@ static int prueth_probe(struct platform_device *pdev)
prueth->miig_rt = syscon_regmap_lookup_by_phandle(np, "ti,mii-g-rt");
if (IS_ERR(prueth->miig_rt)) {
dev_err(dev, "couldn't get ti,mii-g-rt syscon regmap\n");
- return -ENODEV;
+ ret = -ENODEV;
+ goto put_cores;
}
prueth->mii_rt = syscon_regmap_lookup_by_phandle(np, "ti,mii-rt");
if (IS_ERR(prueth->mii_rt)) {
dev_err(dev, "couldn't get ti,mii-rt syscon regmap\n");
- return -ENODEV;
+ ret = -ENODEV;
+ goto put_cores;
}
prueth->pa_stats = syscon_regmap_lookup_by_phandle(np, "ti,pa-stats");
--
2.50.1.windows.1
Technical Details
Message-ID:
<20261110064118.1138-2-laixiangwu@cmss.chinamobile.com>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359919-linux-kernel-netdev=dewy.ruReferences:
<20261110064118.1138-1-laixiangwu@cmss.chinamobile.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359919-linux-kernel-netdev=dewy.ru From: laixiangwu@cmss.chinamobile.com (Xiangwu Lai) Newsgroups: linux.kernel.netdev Subject: [PATCH v2 net 1/4] net: ti: icssg-prueth: Fix device_node refcount leak in prueth_probe() Date: Tue, 10 Nov 2026 14:41:14 +0800 Organization: Usenet Network Message-ID: <20261110064118.1138-2-laixiangwu@cmss.chinamobile.com> References: <20261110064118.1138-1-laixiangwu@cmss.chinamobile.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="541741"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:6AWRJ8Nv+OuW9UGRrROJnhK/8vs= sha256:chue1vfbNfa3DL8R4yqYaaC9arPyouJdkDCtGw/26FA= sha1:laGD8X4MjGReEDAr1i7oSZqfFk0= sha256:HFUUboFWQgWK/r/nhOfz7o9XWashMFwXVsXXPNCwTiw= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 3B5D4113A56; Tue, 10 Nov 2026 09:42:58 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -2.851 X-Spam-Status: No, score=-2.851 tagged_above=-9999 required=6.31 tests=[DKIM_INVALID=0.1, DKIM_SIGNED=0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=fail (1024-bit key) reason="fail (body has been altered)" header.d=cmss.chinamobile.com X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gxGUXODiMMlX; Tue, 10 Nov 2026 09:42:52 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-359919-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=cmss.chinamobile.com X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id 0E3BE113A4A; Tue, 10 Nov 2026 09:42:43 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id D05616403C9; Tue, 10 Nov 2026 06:42:39 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794292886; b=QayUdDQcINdljKstbTlgToq92uhL8s5AXigOsWUMgtGJkoW1Giha+k6DckQa7cIGaMBc bVbqJjUDkRWOHH6JCO5QYmnWyoagbKSbc/qTfmc26XYk1Z5G39mZrC6r7WYfj1rAukPCT raD8TpAYkQlt4WAPfko+lEq/0shBuSBdpUTek2TDgV9bPsG4N3LVwzErUbjb7w5L1VNll 2QMFkm7N5AvkZDXDvMLb0Y5tpR+U4YC6Znge3fpBL4zF2KFG5uPHQx1lzHxeJqd+UkyPr zNzR7a7UwZSfFXiLfZ9a0BKixhFlEkCeglAt3pYxEpBvghfzJTGXeDVKFQF98a0OmwQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794292886; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:X-RM-TagInfo: X-RM-SPAM-FLAG:Received:X-RM-TRANSID:X-RM-TagInfo:X-RM-SPAM-FLAG: Received:X-RM-TRANSID:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:X-Mailing-List:List-Id:List-Post:List-Help: List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Transfer-Encoding; bh=AcfouenU4KIPThaRw9r968DyKfyGZV3RnZDZtnqf6zo=; b=poUm668KeUlP6KHht/pOSBLkhFzi3Ecds7T0yNw3jc9zqSnqQtAcrJ6ZC1F+A/vexp8r q7qDoJpNyX3C9GLjl2ju+hrk60Z+ywfCpbXz9h+5t+iHlrAvGjpWtScLC+fXcK/fhcfvH B4wxV9xyW517Lgc1V91rsaBHwxM9EEEK7skA95BOlejkSYlbEG/BMIXCVlUw98EnPVKc2 Mcf/9N3rjdT6pSvmxW0ynKbhOEivTMTQhaOmIJkOuLu9K6rQ9F7oOfqhDClffLd2GR+qm IiiiHnNcCqyts9ckZQiPow0ZXeEOxoiARqkt2BuRpwRHuwv8UjDkVReYmy/BUdeVbyg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=cmss.chinamobile.com header.i=@cmss.chinamobile.com header.a=rsa-sha256 header.s=default header.b=IzczfaiS; dmarc=pass header.from=cmss.chinamobile.com; spf=pass smtp.mailfrom=cmss.chinamobile.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 027CE6070355; Tue, 10 Nov 2026 06:41:26 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=cmss.chinamobile.com header.i=@cmss.chinamobile.com header.a=rsa-sha256 header.s=default header.b=IzczfaiS X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=111.22.67.135 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794292885; b=N0WOpabirjb7sznATpfDZaz2JMTKTfGvzkJAsOmZ6ThF5RQseJJJljI+rh2H4wDyznPz ONk6NizUoUUUWuMB9TjFdpjTs0Q5nouB2tMXq7vgxaERAuA198JNpUOkiWlU10aItl4zd slza9vStzI3RHqptql/J1KTikiueKg+Vf1fOd4QZBUwMwaxp5DGMi5ifzATo4GKpYnhCg k7xWu6EOzLceGQjXcJLSL32IITVslpOHzPA2efzEsMbYIqMEvQugcDmw2OT17AlWDp0dY WUakwki/k6H/cgB93EsA7jVU0bKbWeoRMA0970ATgriA9PWvh/uMHt5TqyErkk/u4ew== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794292885; h=DMARC-Filter:DKIM-Signature:X-RM-TagInfo:X-RM-SPAM-FLAG:Received: X-RM-TRANSID:X-RM-TagInfo:X-RM-SPAM-FLAG:Received:X-RM-TRANSID:From: To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=AcfouenU4KIPThaRw9r968DyKfyGZV3RnZDZtnqf6zo=; b=dnJw6tFNBLY/y3a11edp/eDUmI2q2W40Bhnlfv4ustR9C5ulQ7QGpYWvlesgIqY439xS 5YYxGnyqRHKPE0kZ1XaXgCBeze4Bke1XgLlgxOtdE/NN5YKRE1jm668/LJ/u46Z/8CTW3 y+mJJkaurG9QMiBnmdBe8+mVR/+fox1d+2fSJAGcTwBpf4ybZq8K3d1DNhiECqvorl9Wc fdb7/Vppn2A56N/YGG8i54QKrsZo4VKrPPO3nGi8dVfum6YbWfiLoJVuWLkNEZwwbyP3m BSnfPd4+FIY2nH/Y87BlIJQhBBAAd1OYdfS0bZZ6xMMC9Wyt6z84QxOxC8dsFYS+BJg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=cmss.chinamobile.com; spf=pass smtp.mailfrom=cmss.chinamobile.com; dkim=pass header.d=cmss.chinamobile.com header.i=@cmss.chinamobile.com header.a=rsa-sha256 header.s=default header.b=IzczfaiS; arc=none smtp.remote-ip=111.22.67.135 X-Received: from cmccmta2.chinamobile.com (cmccmta2.chinamobile.com [111.22.67.135]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AC2D560A6F47; Tue, 10 Nov 2026 06:41:22 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AC2D560A6F47 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmss.chinamobile.com X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmss.chinamobile.com X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmss.chinamobile.com; s=default; l=0; h=from:subject:message-id:to:cc:mime-version; bh=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=; b=IzczfaiSQgI6fDN+NLxxBudjE63hv/B1HxrUmpyqJQUosMdCB8+Qmcf9+vMejuj39WFeIrjMf/kNT ljrmm6jewS04cjn6MZVBkBdHrbBziMgQK8pds39uCJAI83rQPZzDAqy1ZaB63cn9nwT7oNoYns6rOB sey85DuNumvTLY8E= X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 X-Received: from spf.mail.chinamobile.com (unknown[10.188.0.87]) by rmmx-syy-dmz-app03-12003 (RichMail) with SMTP id 2ee36af2bc8e42f-97bdb; Tue, 10 Nov 2026 14:41:21 +0800 (CST) X-RM-TRANSID: 2ee36af2bc8e42f-97bdb X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 X-Received: from (unknown[223.108.79.98]) by rmsmtp-syy-appsvr06-12006 (RichMail) with SMTP id 2ee66af2bc8e8a1-aa5d2; Tue, 10 Nov 2026 14:41:21 +0800 (CST) X-RM-TRANSID: 2ee66af2bc8e8a1-aa5d2 X-Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, danishanwar@ti.com, rogerq@kernel.org, jan.kiszka@siemens.com, diogo.ivo@siemens.com, haokexin@gmail.com, horms@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Xiangwu Lai <laixiangwu@cmss.chinamobile.com> X-Mailer: git-send-email 2.50.1.windows.1 X-In-Reply-To: <20261110064118.1138-1-laixiangwu@cmss.chinamobile.com> X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list