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:
committed by
David S. Miller
parent
7d8e76bf9a
commit
8ea91226ec
@@ -635,8 +635,8 @@ int cfspi_spi_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
ndev = alloc_netdev(sizeof(struct cfspi),
|
ndev = alloc_netdev(sizeof(struct cfspi),
|
||||||
"cfspi%d", cfspi_setup);
|
"cfspi%d", cfspi_setup);
|
||||||
if (!dev)
|
if (!ndev)
|
||||||
return -ENODEV;
|
return -ENOMEM;
|
||||||
|
|
||||||
cfspi = netdev_priv(ndev);
|
cfspi = netdev_priv(ndev);
|
||||||
netif_stop_queue(ndev);
|
netif_stop_queue(ndev);
|
||||||
|
Reference in New Issue
Block a user