Article View: linux.kernel.netdev
Article #7298Re: [PATCH] net: thunderx: fix fwnode_handle leak in bgx_init_of_phy()
From: Andrew Lunn
Date: Mon, 26 Oct 2026 02:02
Date: Mon, 26 Oct 2026 02:02
19 lines
8973 bytes
8973 bytes
On Sun, Oct 25, 2026 at 10:31:59PM +0200, Selby Mashiki wrote:
> In bgx_init_of_phy(), device_for_each_child_node(&bgx->pdev->dev, fwn)
> breaks out of the loop without calling fwnode_handle_put(fwn) if
> to_of_node(fwn) returns NULL.
>
> Switch the loop to device_for_each_child_node_scoped() and remove the
> manual of_node_put(node) calls so the child fwnode_handle reference is
> automatically released on all loop exit paths.
>
> Fixes: 9d28f9491258 ("net: thunder_bgx: add a missing of_node_put")
> Signed-off-by: Selby Mashiki <mashikiselby@gmail.com>
Does a leaked OF node bother anybody? I would say no, so please post
this to net-next.
https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html
Andrew
Technical Details
Message-ID:
<bf64600f-81fa-416d-8d2d-9149e5b62a43@lunn.ch>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-351663-linux-kernel-netdev=dewy.ruReferences:
<20261025203159.455100-1-mashikiselby@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-351663-linux-kernel-netdev=dewy.ru From: andrew@lunn.ch (Andrew Lunn) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH] net: thunderx: fix fwnode_handle leak in bgx_init_of_phy() Date: Mon, 26 Oct 2026 03:02:42 +0100 Organization: Usenet Network Message-ID: <bf64600f-81fa-416d-8d2d-9149e5b62a43@lunn.ch> References: <20261025203159.455100-1-mashikiselby@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="1197405"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:mHFTmJNQCwdyudFQGSBRsloe8vY= sha256:V3mINtM4/q2xiqlfEbGjjF2XH5+vpkde19Tdn6v/LMQ= sha1:/vtb8zkE/ldMHpURERZ+ZmY+8uw= sha256:8zLcyhrGUFhLwQc4EG2nvOiMH5TrWs9PurKoxfJk5cc= Content-Disposition: inline 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 C55F7125B88; Mon, 26 Oct 2026 05:04:41 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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=pass (1024-bit key) header.d=lunn.ch 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 Z3njrAQs-i66; Mon, 26 Oct 2026 05:04:38 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-351663-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=lunn.ch X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 5E234125B87; Mon, 26 Oct 2026 05:04:28 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 4C3CD3B569; Mon, 26 Oct 2026 02:03:12 +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=1792980192; b=O+nT3ddjHxYYicFKBSodfVt1+uD4jYlEmb5W5XudxyZ1QlrDEP6xIidomKoLnIi1kNl7 zj2YhtMd7qaHHHmgMZR3uwMQD/81+p3kqmSP5UNnim5+8VgiHqmkiXlqC1fsyMHFa3VRs 0LAP9gPxZoXgsaaXVHwKBsc5Y8i+yF7XRBU90SeaYjWN2tEz51jN4Doh8aJm3jv6DgRmV IQja1E0Mgpudeup86bxuN958oEnRd0d/g7kDgdxPihtllHhdFI4vJTMlGLz/uT1sp1Cjp IGzNpB7Y6zfV90awMk3MqbCYyBgKVOFL00zWNojO6xWcwHasriQTLdwrO6LDRCHCa2g== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792980192; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:Date: From:To:Cc:Subject:Message-ID:References:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=If3HWL0JukjflKpqf96xpA2ykeHffj+qfMocs+Us2t8=; b=f3sVbyX90DKW5EjPik/btV02gVJJh91pUWry0zk+7ARCzM4Ofv/iZ7555cAohWwhg8yQ v6n62foWms8TWwpavzVl6F59YZ33RoimqkPZ80F3S9NYAlzRV9k7e0aTFRag59fbHGP08 q8UAt0vubMbGw/GDXdULsKSkUBwGEMUiD9QnYDCIhpN5j23vihNC7zJpNz2IoU9Bd70kV wFvUPir8W6B0SKHOwNvlIyMWXI8CbZAMlNF1MxfvBkIuiS7HCbbqBQO4CLIGKQziwpj2w 5145Ww5b1W5vo4YJPiOpPCgdDyW2js0DChFtBrnjEVgWSQQk315zZUbhJnxT0tBnhJg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=33Z96V7u; dmarc=pass header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; 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 24175606A323; Mon, 26 Oct 2026 02:03:12 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=33Z96V7u X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=156.67.10.101 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792980176; b=I9e/bbbyy5FV0NlszrQQUiNB44g7/w6uGYbOkQEc0UX/Kytd+c2DpXecRI5DK60YPfTX m2P2d2Y4nGOqkoc75OTr4qzo+35xboox/wiRKDIc4nlo9QZbrzhRJ1ipkGUIvb5MlsXre rM9XjfSqzQ8Bj+g0aKhEgNxrO8WBKHebv4ruFZQgMVk3Q3p1G9U5WLRez7iZtX6rsOS96 Xb89vCt9+TPnDo5afgQmBd+mnGcU7T0IGZdr9VlzUmvdAqeWbgFwKmcYSlNaJ0GppPnSJ XkHkeLzOxavcFGbxeS95m0Ac24fD8L2odJCKm6SrNTF4/QzwBcpc0JjLy+84xwcHFqQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792980176; h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject: Message-ID:References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To; bh=If3HWL0JukjflKpqf96xpA2ykeHffj+qfMocs+Us2t8=; b=LgC+/kg30BoK0DmaBmRkrLE2y72+6X1eFOd8qlwwmUDIioLOSmHAPiVE4LSBx9s7Azwx 7bfAJQVMfgV8FsBoToLqmqfTj5exwLxt2uATZhretR63GumPFTvFcxWOUVIRhTmUDsXaU 4zbxwxLu9ZARuHcZhpma7yUcuh4+Rtrx/fyluhbyzyT6H37QV4XNsBGbC06ax9odAiO0L LVKgo3sLuMI7AG0QxvXgB25+0A0pu1cCm/d9sv+/ncqUz6BOHh5fyn9EHKaYL7nhbF6lD uWiwjWzKhSZUwwIQMMNJH4UljJvJknz6p20P2enC5plIaN7gY9i8lhhE0Mne5hjW0Sw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=33Z96V7u; arc=none smtp.remote-ip=156.67.10.101 X-Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DCC23606A31A; Mon, 26 Oct 2026 02:02:55 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DCC23606A31A X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=If3HWL0JukjflKpqf96xpA2ykeHffj+qfMocs+Us2t8=; b=33Z96V7uKHmJYA4kqMyKvxyWRr SY+8c0tjqz9TIfZcZAkLR+RYcIVqayY7li8Ikr5RGProVdbChN4oCS6ntcopLFVec4vA+OJrwyI0i y8l2KMsyuvOwaFOxT01JiT3vt+5Jsx2f1F3qJamwxvBy0A8GPlaCwFEXSk8ETBXGyKpw=; X-Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from <andrew@lunn.ch>) id 1xLA2s-00Cjim-Ru; Mon, 26 Oct 2026 03:02:42 +0100 X-Cc: Sunil Goutham <sgoutham@marvell.com>, Andrew Lunn <andrew+netdev@lunn.ch>, "David S . Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org 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 X-In-Reply-To: <20261025203159.455100-1-mashikiselby@gmail.com>