net: dsa: mxl862xx: cancel pending work on probe error
Daniel Golle
maintainerPATCH 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.
---
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
@@ -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
Quoted 5 lines · Daniel Golle
Call
mxl862xx_host_shutdown()in casedsa_register_switch()returns an error, so any still pendingcrc_err_workget canceled.Fixes a319d0c8c8ce ("net: dsa: mxl862xx: add CRC for MDIO communication")Signed-off-by Daniel Golle <[email protected]>
Andrew
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 casedsa_register_switch()returns an error, so any still pendingcrc_err_workget canceled.Fixes a319d0c8c8ce ("net: dsa: mxl862xx: add CRC for MDIO communication")Signed-off-by Daniel Golle <[email protected]>---
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