Skip to content

Commit

Permalink
mac80211: Add netif state checking to ieee80211_ifa_changed
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Juuso Oikarinen authored and John W. Linville committed Jun 8, 2010
1 parent 3cfd43f commit 90b7260
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/mac80211/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,9 @@ static int ieee80211_ifa_changed(struct notifier_block *nb,
struct ieee80211_sub_if_data *sdata;
struct ieee80211_if_managed *ifmgd;

if (!netif_running(ndev))
return NOTIFY_DONE;

/* Make sure it's our interface that got changed */
if (!wdev)
return NOTIFY_DONE;
Expand Down

0 comments on commit 90b7260

Please sign in to comment.