mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-10 15:58:47 +00:00
can: tcan4x5x: tcan4x5x_can_probe(): add missing error handling if mcan_class is NULL
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>
This commit is contained in:
parent
ad07819f22
commit
7fbda13065
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user