summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx
diff options
context:
space:
mode:
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>2010-11-18 15:19:02 +0200
committerLuciano Coelho <luciano.coelho@nokia.com>2010-11-23 10:29:29 +0200
commit6735329934e9acc1941a991ed6f6ad4be3e082a5 (patch)
treee64ec0987e322592b0b6e8bf6cd7bb88c429be24 /drivers/net/wireless/wl12xx
parentb84a7d3d9e7cd5a25f4fd32142cebdf4481a74a4 (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/wireless/wl12xx')
-rw-r--r--drivers/net/wireless/wl12xx/main.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 708ffe304c6..35cfcf67579 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,
struct wl1271 *wl = hw->priv;
mutex_lock(&wl->mutex);
- WARN_ON(wl->vif != vif);
- __wl1271_op_remove_interface(wl);
- mutex_unlock(&wl->mutex);
+ /*
+ * wl->vif can be null here if someone shuts down the interface
+ * just when hardware recovery has been started.
+ */
+ if (wl->vif) {
+ WARN_ON(wl->vif != vif);
+ __wl1271_op_remove_interface(wl);
+ }
+ mutex_unlock(&wl->mutex);
cancel_work_sync(&wl->recovery_work);
}