Skip to contentSkip to conversation

softmac: alloc_ieee80211() NULL check

PATCH New Akinobu Mita 1 participant 1 message May 27, 2007 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 softmac: alloc_ieee80211() NULL check

This patch adds missing NULL check and trims a line longer than 80 columns.

Cc John W. Linville <[email protected]>
Cc Johannes Berg <[email protected]>
Cc Joe Jezak <[email protected]>
Cc Daniel Drake <[email protected]>
---
 net/ieee80211/softmac/ieee80211softmac_module.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
net/ieee80211/softmac/ieee80211softmac_module.c +4 -1
Index: 2.6-mm/net/ieee80211/softmac/ieee80211softmac_module.c
===================================================================
@@ -33,7 +33,10 @@ struct net_device *alloc_ieee80211softma
 	struct ieee80211softmac_device *softmac;
 	struct net_device *dev;
 
-	dev = alloc_ieee80211(sizeof(struct ieee80211softmac_device) + sizeof_priv);
+	dev = alloc_ieee80211(sizeof(*softmac) + sizeof_priv);
+	if (!dev)
+		return NULL;
+
 	softmac = ieee80211_priv(dev);
 	softmac->dev = dev;
 	softmac->ieee = netdev_priv(dev);