Skip to contentSkip to conversation

net: dsa: mxl862xx: cancel pending work on probe error

PATCH Applied Daniel Golle 3 participants 3 messages Mar 30 – Apr 1

Subsystems (4)
lore
Share & tools
lore

Daniel Golle

author maintainer
#0 lore raw

PATCH 1/1 net: dsa: mxl862xx: cancel pending work on probe error

Call mxl862xx_host_shutdown() in case dsa_register_switch() returns an error, so any still pending crc_err_work get canceled.

Fixes a319d0c8c8ce ("net: dsa: mxl862xx: add CRC for MDIO communication")

---
Note that this targets net-next despite having a Fixes:-tag because the is still only in net-next.

 drivers/net/dsa/mxl862xx/mxl862xx.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/dsa/mxl862xx/mxl862xx.c +6 -1
index 78eef639628a0..af9b00b2d2c43 100644
@@ -407,6 +407,7 @@ static int mxl862xx_probe(struct mdio_device *mdiodev)
 	struct device *dev = &mdiodev->dev;
 	struct mxl862xx_priv *priv;
 	struct dsa_switch *ds;
+	int err;
 
 	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
 	if (!priv)
@@ -428,7 +429,11 @@ static int mxl862xx_probe(struct mdio_device *mdiodev)
 
 	dev_set_drvdata(dev, ds);
 
-	return dsa_register_switch(ds);
+	err = dsa_register_switch(ds);
+	if (err)
+		mxl862xx_host_shutdown(priv);
+
+	return err;
 }
 
 static void mxl862xx_remove(struct mdio_device *mdiodev)
Signature · 1 line
2.53.0
#2 lore raw
In reply to Daniel Golle
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Mon, 30 Mar 2026 23:52:09 +0100 you wrote:

Call mxl862xx_host_shutdown() in case dsa_register_switch() returns an error, so any still pending crc_err_work get canceled.

Fixes a319d0c8c8ce ("net: dsa: mxl862xx: add CRC for MDIO communication")

---
Note that this targets net-next despite having a Fixes:-tag because the is still only in net-next.

[...]

Here is the summary with links:
- [net-next] net: dsa: mxl862xx: cancel pending work on probe error

    https://git.kernel.org/netdev/net-next/c/e9abf1da0af3

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html