linux-can-fixes-for-6.1-20221025

-----BEGIN PGP SIGNATURE-----
 
 iQFHBAABCgAxFiEEBsvAIBsPu6mG7thcrX5LkNig010FAmNXt/oTHG1rbEBwZW5n
 dXRyb25peC5kZQAKCRCtfkuQ2KDTXalKCACzJ2IcCfcBesx/Qf5pFlP9uGEKMFx7
 knSo3tgiGneBJkAqIFowpPj8Qjgh34n8uE7jAXNC0HBpDmPdx1y9DXyR8dsUzDzs
 bmUofX4NgwPY+w42/Lzi6nnWgLdas1VNAxJXPVfBV2F6EApT1b1eHOVwxi/evF+S
 VvYdA9OaeAo44OcIIYYo8apcKM9N7FL2PlrvmNOfryQdmUC1gC+l9GUxX/W+rTYY
 a3r/lkmqrJnqnftCieNCcZvrs2oAm/YQc08R5IQhKBddoknHrEGSlyl4qdpwY1rg
 uIRTurechFS9Z5TjVspPwZdt/Xj6j2KJcjyZyALdaD4V6uXWbtKNU5kI
 =JIG9
 -----END PGP SIGNATURE-----

Merge tag 'linux-can-fixes-for-6.1-20221025' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can

Marc Kleine-Budde says:

====================
pull-request: can 2022-10-25

The 1st patch adds a missing cleanup call in the error path of the
probe function in mpc5xxx glue code for the mscan driver.

The 2nd patch adds a missing cleanup call in the error path of the
probe function of the mcp251x driver.

* tag 'linux-can-fixes-for-6.1-20221025' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can:
  can: mcp251x: mcp251x_can_probe(): add missing unregister_candev() in error path
  can: mscan: mpc5xxx: mpc5xxx_can_probe(): add missing put_clock() in error path
====================

Link: https://lore.kernel.org/r/20221026075520.1502520-1-mkl@pengutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Jakub Kicinski 2022-10-26 20:12:50 -07:00
commit 8b9d377afa
2 changed files with 9 additions and 4 deletions

View file

@ -322,14 +322,14 @@ static int mpc5xxx_can_probe(struct platform_device *ofdev)
&mscan_clksrc);
if (!priv->can.clock.freq) {
dev_err(&ofdev->dev, "couldn't get MSCAN clock properties\n");
goto exit_free_mscan;
goto exit_put_clock;
}
err = register_mscandev(dev, mscan_clksrc);
if (err) {
dev_err(&ofdev->dev, "registering %s failed (err=%d)\n",
DRV_NAME, err);
goto exit_free_mscan;
goto exit_put_clock;
}
dev_info(&ofdev->dev, "MSCAN at 0x%p, irq %d, clock %d Hz\n",
@ -337,7 +337,9 @@ static int mpc5xxx_can_probe(struct platform_device *ofdev)
return 0;
exit_free_mscan:
exit_put_clock:
if (data->put_clock)
data->put_clock(ofdev);
free_candev(dev);
exit_dispose_irq:
irq_dispose_mapping(irq);

View file

@ -1415,11 +1415,14 @@ static int mcp251x_can_probe(struct spi_device *spi)
ret = mcp251x_gpio_setup(priv);
if (ret)
goto error_probe;
goto out_unregister_candev;
netdev_info(net, "MCP%x successfully initialized.\n", priv->model);
return 0;
out_unregister_candev:
unregister_candev(net);
error_probe:
destroy_workqueue(priv->wq);
priv->wq = NULL;