[PATCH] mac80211: avoid null ptr deref in ieee80211_ibss_add_sta
authorJohn W. Linville <linville@tuxdriver.com>
Tue, 15 May 2007 20:14:40 +0000 (16:14 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 29 May 2007 14:34:05 +0000 (10:34 -0400)
avoid sdata null pointer dereference in ieee80211_ibss_add_sta.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/ieee80211_sta.c

index dbac858..9f30ae4 100644 (file)
@@ -2997,7 +2997,7 @@ struct sta_info * ieee80211_ibss_add_sta(struct net_device *dev,
 {
        struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
        struct sta_info *sta;
-       struct ieee80211_sub_if_data *sdata = NULL;
+       struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
 
        /* TODO: Could consider removing the least recently used entry and
         * allow new one to be added. */