]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
wireless: b43: fix Oops on card eject during transfer
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Fri, 6 Jan 2012 11:58:16 +0000 (12:58 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 13 Jan 2012 19:40:50 +0000 (14:40 -0500)
An Oops has once been observed, when the SDIO card had been ejected during
IO. The PC value shows, that the dev pointer in b43_op_stop() was NULL.

(I moved the NULL check before the lock, based upon a suggestion from
Julian Calaby <julian.calaby@gmail.com>. -- JWL)

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/b43/main.c

index 1c6f19393efa72037b7369993bf7af463a7bb51a..b91f28ef1032e40791f4d385d3e92e4646464a3f 100644 (file)
@@ -4852,6 +4852,9 @@ static void b43_op_stop(struct ieee80211_hw *hw)
 
        cancel_work_sync(&(wl->beacon_update_trigger));
 
+       if (!dev)
+               goto out;
+
        mutex_lock(&wl->mutex);
        if (b43_status(dev) >= B43_STAT_STARTED) {
                dev = b43_wireless_core_stop(dev);
@@ -4863,7 +4866,7 @@ static void b43_op_stop(struct ieee80211_hw *hw)
 
 out_unlock:
        mutex_unlock(&wl->mutex);
-
+out:
        cancel_work_sync(&(wl->txpower_adjust_work));
 }