ath9k: Fix kernel panic on module unload
authorRajkumar Manoharan <rmanoharan@atheros.com>
Fri, 8 Apr 2011 11:36:25 +0000 (17:06 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 12 Apr 2011 20:58:43 +0000 (16:58 -0400)
The commit "ath9k: configure beacons based on hw opmode" introduced
a regression which leads to kernel panic. Failed to stop ani timer
during the driver unload while any of the beaconing vif is running.

Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/beacon.c
drivers/net/wireless/ath/ath9k/main.c

index eccb0ec87adbca404416863f0b6193e54980d783..b56f69e7677b30f8ac759767390e1a4c805fc2fa 100644 (file)
@@ -320,6 +320,7 @@ void ath_beacon_return(struct ath_softc *sc, struct ath_vif *avp)
        if (avp->av_bcbuf != NULL) {
                struct ath_buf *bf;
 
+               avp->is_bslot_active = false;
                if (avp->av_bslot != -1) {
                        sc->beacon.bslot[avp->av_bslot] = NULL;
                        sc->nbcnvifs--;
index 93b9fa2cbaf82e25e3ac79f2480ed5feb0400438..a55a8929810b4d4b99aa23d03c4b77caba31f1e7 100644 (file)
@@ -1375,6 +1375,9 @@ static void ath9k_calculate_summary_state(struct ieee80211_hw *hw,
        if ((iter_data.naps + iter_data.nadhocs) > 0) {
                sc->sc_flags |= SC_OP_ANI_RUN;
                ath_start_ani(common);
+       } else {
+               sc->sc_flags &= ~SC_OP_ANI_RUN;
+               del_timer_sync(&common->ani.timer);
        }
 }