Skip to content

Commit 8b9d377

Browse files
committed
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>
2 parents c5f0a17 + b1a09b6 commit 8b9d377

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

drivers/net/can/mscan/mpc5xxx_can.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,22 +322,24 @@ static int mpc5xxx_can_probe(struct platform_device *ofdev)
322322
&mscan_clksrc);
323323
if (!priv->can.clock.freq) {
324324
dev_err(&ofdev->dev, "couldn't get MSCAN clock properties\n");
325-
goto exit_free_mscan;
325+
goto exit_put_clock;
326326
}
327327

328328
err = register_mscandev(dev, mscan_clksrc);
329329
if (err) {
330330
dev_err(&ofdev->dev, "registering %s failed (err=%d)\n",
331331
DRV_NAME, err);
332-
goto exit_free_mscan;
332+
goto exit_put_clock;
333333
}
334334

335335
dev_info(&ofdev->dev, "MSCAN at 0x%p, irq %d, clock %d Hz\n",
336336
priv->reg_base, dev->irq, priv->can.clock.freq);
337337

338338
return 0;
339339

340-
exit_free_mscan:
340+
exit_put_clock:
341+
if (data->put_clock)
342+
data->put_clock(ofdev);
341343
free_candev(dev);
342344
exit_dispose_irq:
343345
irq_dispose_mapping(irq);

drivers/net/can/spi/mcp251x.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1415,11 +1415,14 @@ static int mcp251x_can_probe(struct spi_device *spi)
14151415

14161416
ret = mcp251x_gpio_setup(priv);
14171417
if (ret)
1418-
goto error_probe;
1418+
goto out_unregister_candev;
14191419

14201420
netdev_info(net, "MCP%x successfully initialized.\n", priv->model);
14211421
return 0;
14221422

1423+
out_unregister_candev:
1424+
unregister_candev(net);
1425+
14231426
error_probe:
14241427
destroy_workqueue(priv->wq);
14251428
priv->wq = NULL;

0 commit comments

Comments
 (0)