public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: phy: intel-xway: fix OF node refcount leakage
@ 2026-01-18  3:57 Daniel Golle
  2026-01-19 14:05 ` Andrew Lunn
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Golle @ 2026-01-18  3:57 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, netdev, linux-kernel

Automated review spotted an OF node reference count when checking if the
'leds' child node exists. Call of_put_node() to maintain the refcount.

Link: https://netdev-ai.bots.linux.dev/ai-review.html?id=20f173ba-0c64-422b-a663-fea4b4ad01d0
Fixes: ("1758af47b98c1 net: phy: intel-xway: add support for PHY LEDs")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
 drivers/net/phy/intel-xway.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/intel-xway.c b/drivers/net/phy/intel-xway.c
index 9766dd99afaa0..12ff4c1f285d2 100644
--- a/drivers/net/phy/intel-xway.c
+++ b/drivers/net/phy/intel-xway.c
@@ -277,7 +277,7 @@ static int xway_gphy_init_leds(struct phy_device *phydev)
 
 static int xway_gphy_config_init(struct phy_device *phydev)
 {
-	struct device_node *np = phydev->mdio.dev.of_node;
+	struct device_node *np;
 	int err;
 
 	/* Mask all interrupts */
@@ -286,7 +286,10 @@ static int xway_gphy_config_init(struct phy_device *phydev)
 		return err;
 
 	/* Use default LED configuration if 'leds' node isn't defined */
-	if (!of_get_child_by_name(np, "leds"))
+	np = of_get_child_by_name(phydev->mdio.dev.of_node, "leds");
+	if (np)
+		of_node_put(np);
+	else
 		xway_gphy_init_leds(phydev);
 
 	/* Clear all pending interrupts */
-- 
2.52.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: phy: intel-xway: fix OF node refcount leakage
  2026-01-18  3:57 [PATCH net] net: phy: intel-xway: fix OF node refcount leakage Daniel Golle
@ 2026-01-19 14:05 ` Andrew Lunn
  2026-01-19 14:08   ` Daniel Golle
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Lunn @ 2026-01-19 14:05 UTC (permalink / raw)
  To: Daniel Golle
  Cc: Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netdev, linux-kernel

On Sun, Jan 18, 2026 at 03:57:04AM +0000, Daniel Golle wrote:
> Automated review spotted an OF node reference count when checking if the
> 'leds' child node exists. Call of_put_node() to maintain the refcount.
> 
> Link: https://netdev-ai.bots.linux.dev/ai-review.html?id=20f173ba-0c64-422b-a663-fea4b4ad01d0
> Fixes: ("1758af47b98c1 net: phy: intel-xway: add support for PHY LEDs")
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: phy: intel-xway: fix OF node refcount leakage
  2026-01-19 14:05 ` Andrew Lunn
@ 2026-01-19 14:08   ` Daniel Golle
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Golle @ 2026-01-19 14:08 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netdev, linux-kernel

On Mon, Jan 19, 2026 at 03:05:54PM +0100, Andrew Lunn wrote:
> On Sun, Jan 18, 2026 at 03:57:04AM +0000, Daniel Golle wrote:
> > Automated review spotted an OF node reference count when checking if the
> > 'leds' child node exists. Call of_put_node() to maintain the refcount.
> > 
> > Link: https://netdev-ai.bots.linux.dev/ai-review.html?id=20f173ba-0c64-422b-a663-fea4b4ad01d0
> > Fixes: ("1758af47b98c1 net: phy: intel-xway: add support for PHY LEDs")
> > Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> 
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>

I guess you meant to put your Reviewed-by: under v2 I've sent yesterday
because this initial submission has a fat-fingered Fixes:-tag...

See
https://patchwork.kernel.org/project/netdevbpf/patch/e3275e1c1cdca7e6426bb9c11f33bd84b8d900c8.1768783208.git.daniel@makrotopia.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-01-19 14:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-18  3:57 [PATCH net] net: phy: intel-xway: fix OF node refcount leakage Daniel Golle
2026-01-19 14:05 ` Andrew Lunn
2026-01-19 14:08   ` Daniel Golle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox