Skip to content

Commit

Permalink
wl12xx: Fix kernel crash related to hw recovery and interface shutdown
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Juuso Oikarinen authored and Luciano Coelho committed Nov 23, 2010
1 parent b84a7d3 commit 6735329
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions drivers/net/wireless/wl12xx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 6735329

Please sign in to comment.