Skip to content

Commit 4cc7faa

Browse files
Dan Carpentermarckleinebudde
authored andcommitted
can: mcp251xfd: mcp251xfd_probe(): fix an error pointer dereference in probe
When we converted this code to use dev_err_probe() we accidentally removed a return. It means that if devm_clk_get() it will lead to an Oops when we call clk_get_rate() on the next line. Fixes: cf8ee6d ("can: mcp251xfd: mcp251xfd_probe(): use dev_err_probe() to simplify error handling") Link: https://lore.kernel.org/r/YJANZf13Qxd5Mhr1@mwanda Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
1 parent 8621436 commit 4cc7faa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2885,8 +2885,8 @@ static int mcp251xfd_probe(struct spi_device *spi)
28852885

28862886
clk = devm_clk_get(&spi->dev, NULL);
28872887
if (IS_ERR(clk))
2888-
dev_err_probe(&spi->dev, PTR_ERR(clk),
2889-
"Failed to get Oscillator (clock)!\n");
2888+
return dev_err_probe(&spi->dev, PTR_ERR(clk),
2889+
"Failed to get Oscillator (clock)!\n");
28902890
freq = clk_get_rate(clk);
28912891

28922892
/* Sanity check */

0 commit comments

Comments
 (0)