aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorVasiliy Kulikov <segoon@openwall.com>2010-11-18 13:35:58 -0500
committerDavid S. Miller <davem@davemloft.net>2010-11-18 13:35:58 -0500
commit8ea91226eccf6c8ab9c55054b24c21021d4d9d19 (patch)
tree70fd9d9479d09c1dcf7d97264ebc03fd66e9cc11 /drivers
parent7d8e76bf9ac3604897f0ce12e8bf09b68c2a2c89 (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/caif/caif_spi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/caif/caif_spi.c b/drivers/net/caif/caif_spi.c
index 8b4cea57a6c5..20da1996d354 100644
--- a/drivers/net/caif/caif_spi.c
+++ b/drivers/net/caif/caif_spi.c
@@ -635,8 +635,8 @@ int cfspi_spi_probe(struct platform_device *pdev)
635 635
636 ndev = alloc_netdev(sizeof(struct cfspi), 636 ndev = alloc_netdev(sizeof(struct cfspi),
637 "cfspi%d", cfspi_setup); 637 "cfspi%d", cfspi_setup);
638 if (!dev) 638 if (!ndev)
639 return -ENODEV; 639 return -ENOMEM;
640 640
641 cfspi = netdev_priv(ndev); 641 cfspi = netdev_priv(ndev);
642 netif_stop_queue(ndev); 642 netif_stop_queue(ndev);