Commit 8ea91226 authored by Vasiliy Kulikov's avatar Vasiliy Kulikov Committed by David S. Miller

net: caif: spi: fix potential NULL dereference

alloc_netdev() is not checked here for NULL return value.  dev is
check instead.  It might lead to NULL dereference of ndev.
Signed-off-by: default avatarVasiliy Kulikov <segoon@openwall.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7d8e76bf
......@@ -635,8 +635,8 @@ int cfspi_spi_probe(struct platform_device *pdev)
ndev = alloc_netdev(sizeof(struct cfspi),
"cfspi%d", cfspi_setup);
if (!dev)
return -ENODEV;
if (!ndev)
return -ENOMEM;
cfspi = netdev_priv(ndev);
netif_stop_queue(ndev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment