diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/can/m_can/tcan4x5x.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/can/m_can/tcan4x5x.c b/drivers/net/can/m_can/tcan4x5x.c index a2d5e501a502..7a73a4cfc1bb 100644 --- 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; |