OSDN Git Service
(root)
/
android-x86
/
kernel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ad07819
)
can: tcan4x5x: tcan4x5x_can_probe(): add missing error handling if mcan_class is...
author
Marc Kleine-Budde
<mkl@pengutronix.de>
Mon, 19 Aug 2019 17:34:28 +0000
(19:34 +0200)
committer
Marc Kleine-Budde
<mkl@pengutronix.de>
Tue, 20 Aug 2019 11:41:26 +0000
(13:41 +0200)
This patch adds the missing error handling in tcan4x5x_can_probe() if
mcan_class is NULL.
Fixes:
5443c226ba91
("can: tcan4x5x: Add tcan4x5x driver to the kernel")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/m_can/tcan4x5x.c
patch
|
blob
|
history
diff --git
a/drivers/net/can/m_can/tcan4x5x.c
b/drivers/net/can/m_can/tcan4x5x.c
index
a2d5e50
..
7a73a4c
100644
(file)
--- a/
drivers/net/can/m_can/tcan4x5x.c
+++ b/
drivers/net/can/m_can/tcan4x5x.c
@@
-414,6
+414,9
@@
static int tcan4x5x_can_probe(struct spi_device *spi)
int freq, ret;
mcan_class = m_can_class_allocate_dev(&spi->dev);
+ if (!mcan_class)
+ return -ENOMEM;
+
priv = devm_kzalloc(&spi->dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;