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: Vasiliy Kulikov <segoon@openwall.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
7d8e76bf9a
commit
8ea91226ec
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue