aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/main.c
diff options
context:
space:
mode:
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>2010-06-07 03:52:12 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-06-08 09:31:21 -0400
commit90b726097ba0dcc1f9725182513e669a30e77db5 (patch)
tree34e18b515c3f3d39b3f604ee2034441b85f23c3a /net/mac80211/main.c
parent3cfd43f484c8d4bcb38db83f7be19fbd4ac8440c (diff)
mac80211: Add netif state checking to ieee80211_ifa_changed
There's a window for ieee80211_ifa_changed() to get called whilst the managed mode mutex has not been initialized when opening and stopping the interface. Currently this causes a kernel BUG like the following: [ 132.460013] kernel BUG at /home/wifi/iwlwifi-2.6/net/mac80211/main.c:380! [ 132.460013] invalid opcode: 0000 [#1] SMP The mutex is initialized during open(), hence once netif_running() is true, the mutex should be valid. Fix by adding a netif_running() check to the function. Reported-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Tested-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/main.c')
-rw-r--r--net/mac80211/main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 5706156d1ecf..88b671a16a41 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -359,6 +359,9 @@ static int ieee80211_ifa_changed(struct notifier_block *nb,
359 struct ieee80211_sub_if_data *sdata; 359 struct ieee80211_sub_if_data *sdata;
360 struct ieee80211_if_managed *ifmgd; 360 struct ieee80211_if_managed *ifmgd;
361 361
362 if (!netif_running(ndev))
363 return NOTIFY_DONE;
364
362 /* Make sure it's our interface that got changed */ 365 /* Make sure it's our interface that got changed */
363 if (!wdev) 366 if (!wdev)
364 return NOTIFY_DONE; 367 return NOTIFY_DONE;