mac80211: Add netif state checking to ieee80211_ifa_changed
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>
Mon, 7 Jun 2010 07:52:12 +0000 (10:52 +0300)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 8 Jun 2010 13:31:21 +0000 (09:31 -0400)
commit90b726097ba0dcc1f9725182513e669a30e77db5
tree34e18b515c3f3d39b3f604ee2034441b85f23c3a
parent3cfd43f484c8d4bcb38db83f7be19fbd4ac8440c
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>
net/mac80211/main.c