diff options
author | Marc Kleine-Budde | 2019-08-19 19:34:28 +0200 |
---|---|---|
committer | Marc Kleine-Budde | 2019-08-20 13:41:26 +0200 |
commit | b3402c405747c4b6a9fe2d0a225835d95abd8496 (patch) | |
tree | 619d6a7a112aeb0eed02afc229879d2a85eb98c3 /drivers/net/can | |
parent | 28b0ffe98b53cf1f3e58023699886f813fb26144 (diff) |
can: m_can_platform: m_can_plat_probe(): add missing error handling if mcan_class is NULL
This patch adds the missing error handling in m_can_plat_probe() if
mcan_class is NULL.
Fixes: f524f829b75a ("can: m_can: Create a m_can platform framework")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can')
-rw-r--r-- | drivers/net/can/m_can/m_can_platform.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/can/m_can/m_can_platform.c b/drivers/net/can/m_can/m_can_platform.c index 2c6ef861d4a2..6ac4c35f247a 100644 --- a/drivers/net/can/m_can/m_can_platform.c +++ b/drivers/net/can/m_can/m_can_platform.c @@ -63,6 +63,9 @@ static int m_can_plat_probe(struct platform_device *pdev) int irq, ret = 0; mcan_class = m_can_class_allocate_dev(&pdev->dev); + if (!mcan_class) + return -ENOMEM; + priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; |