summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2021-05-02 12:34:34 +0300
committerMarc Kleine-Budde <mkl@pengutronix.de>2021-05-06 10:24:06 +0300
commit4376ea42db8bfcac2bc3a30bba93917244a8c2d4 (patch)
tree6b647fa2cd33fef1d3286f516e3659a1bc790ffb /drivers
parent4cc7faa406975b460aa674606291dea197c1210c (diff)
downloadlinux-4376ea42db8bfcac2bc3a30bba93917244a8c2d4.tar.xz
can: mcp251xfd: mcp251xfd_probe(): add missing can_rx_offload_del() in error path
This patch adds the missing can_rx_offload_del(), that must be called if mcp251xfd_register() fails. Fixes: 55e5b97f003e ("can: mcp25xxfd: add driver for Microchip MCP25xxFD SPI CAN") Link: https://lore.kernel.org/r/20210504091838.1109047-1-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
index f122976e90da..e0ae00e34c7b 100644
--- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
+++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
@@ -2986,10 +2986,12 @@ static int mcp251xfd_probe(struct spi_device *spi)
err = mcp251xfd_register(priv);
if (err)
- goto out_free_candev;
+ goto out_can_rx_offload_del;
return 0;
+ out_can_rx_offload_del:
+ can_rx_offload_del(&priv->offload);
out_free_candev:
spi->max_speed_hz = priv->spi_max_speed_hz_orig;