Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/3fd163f5bb88de426ca9847549f94b4296170ef0.1774911025.git.daniel@makrotopia.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Daniel Golle and committed by
Jakub Kicinski
e9abf1da 9229cb5a

+6 -1
+6 -1
drivers/net/dsa/mxl862xx/mxl862xx.c
··· 407 407 struct device *dev = &mdiodev->dev; 408 408 struct mxl862xx_priv *priv; 409 409 struct dsa_switch *ds; 410 + int err; 410 411 411 412 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); 412 413 if (!priv) ··· 429 428 430 429 dev_set_drvdata(dev, ds); 431 430 432 - return dsa_register_switch(ds); 431 + err = dsa_register_switch(ds); 432 + if (err) 433 + mxl862xx_host_shutdown(priv); 434 + 435 + return err; 433 436 } 434 437 435 438 static void mxl862xx_remove(struct mdio_device *mdiodev)