Skip to content

Commit

Permalink
can: mcp251xfd: mcp251xfd_probe(): add missing can_rx_offload_del() i…
Browse files Browse the repository at this point in the history
…n error path

[ Upstream commit 4376ea4 ]

This patch adds the missing can_rx_offload_del(), that must be called
if mcp251xfd_register() fails.

Fixes: 55e5b97 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
marckleinebudde authored and gregkh committed May 19, 2021
1 parent 15f8f96 commit eb40b2f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2957,10 +2957,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;

Expand Down

0 comments on commit eb40b2f

Please sign in to comment.