diff options
author | Juuso Oikarinen <juuso.oikarinen@nokia.com> | 2010-11-18 08:19:02 -0500 |
---|---|---|
committer | Luciano Coelho <luciano.coelho@nokia.com> | 2010-11-23 03:29:29 -0500 |
commit | 6735329934e9acc1941a991ed6f6ad4be3e082a5 (patch) | |
tree | e64ec0987e322592b0b6e8bf6cd7bb88c429be24 /drivers/net | |
parent | b84a7d3d9e7cd5a25f4fd32142cebdf4481a74a4 (diff) |
wl12xx: Fix kernel crash related to hw recovery and interface shutdown
It is possible that the op_remove_interface function is invoked exactly at
the same time has hw recovery is started. In this case it is possible for the
interface to be already removed in the op_remove_interface call, which
currently leads to a kernel warning and a subsequent kernel crash.
Fix this by ignoring the op_remove_interface call if the interface is already
down at that point.
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Tested-by: Tuomas Katila <ext-tuomas.2.katila@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/wl12xx/main.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c index 708ffe304c6d..35cfcf675795 100644 --- a/drivers/net/wireless/wl12xx/main.c +++ b/drivers/net/wireless/wl12xx/main.c | |||
@@ -1157,10 +1157,16 @@ static void wl1271_op_remove_interface(struct ieee80211_hw *hw, | |||
1157 | struct wl1271 *wl = hw->priv; | 1157 | struct wl1271 *wl = hw->priv; |
1158 | 1158 | ||
1159 | mutex_lock(&wl->mutex); | 1159 | mutex_lock(&wl->mutex); |
1160 | WARN_ON(wl->vif != vif); | 1160 | /* |
1161 | __wl1271_op_remove_interface(wl); | 1161 | * wl->vif can be null here if someone shuts down the interface |
1162 | mutex_unlock(&wl->mutex); | 1162 | * just when hardware recovery has been started. |
1163 | */ | ||
1164 | if (wl->vif) { | ||
1165 | WARN_ON(wl->vif != vif); | ||
1166 | __wl1271_op_remove_interface(wl); | ||
1167 | } | ||
1163 | 1168 | ||
1169 | mutex_unlock(&wl->mutex); | ||
1164 | cancel_work_sync(&wl->recovery_work); | 1170 | cancel_work_sync(&wl->recovery_work); |
1165 | } | 1171 | } |
1166 | 1172 | ||