From ef7ab2357ba09e8a795018640a87e93dfa043360 Mon Sep 17 00:00:00 2001 From: Akinobu Mita Date: Sun, 27 May 2007 23:26:31 +0900 Subject: [PATCH] [PATCH] softmac: alloc_ieee80211() NULL check This patch adds missing NULL check and trims a line longer than 80 columns. Cc: Johannes Berg Cc: Joe Jezak Cc: Daniel Drake Signed-off-by: Akinobu Mita Signed-off-by: John W. Linville --- net/ieee80211/softmac/ieee80211softmac_module.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/ieee80211/softmac/ieee80211softmac_module.c b/net/ieee80211/softmac/ieee80211softmac_module.c index e9cdc6615ddc..c308756c2f9d 100644 --- a/net/ieee80211/softmac/ieee80211softmac_module.c +++ b/net/ieee80211/softmac/ieee80211softmac_module.c @@ -33,7 +33,10 @@ struct net_device *alloc_ieee80211softmac(int sizeof_priv) 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); -- 2.20.1