aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRajkumar Manoharan <rmanoharan@atheros.com>2010-07-08 02:42:29 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-07-14 13:52:45 -0400
commit447a42c2feb1091f217c1d50000d8cddf39addb5 (patch)
tree5a4066686fa0c3fdd803f65b974ab1d5c094d133
parent6eb90d46c59a75ceeccfef7c6c6705fb64b593dc (diff)
ath9k: fix panic while cleaning up virtaul wifis
num_sec_wiphy means max secondary wifis that the driver can accomudate. So cancelling wiphy work should be based on the presence of secondary wifis. Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/init.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c8
2 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index fe730cb16ec2..243c1775f343 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -787,12 +787,12 @@ void ath9k_deinit_device(struct ath_softc *sc)
787 ieee80211_unregister_hw(aphy->hw); 787 ieee80211_unregister_hw(aphy->hw);
788 ieee80211_free_hw(aphy->hw); 788 ieee80211_free_hw(aphy->hw);
789 } 789 }
790 kfree(sc->sec_wiphy);
791 790
792 ieee80211_unregister_hw(hw); 791 ieee80211_unregister_hw(hw);
793 ath_rx_cleanup(sc); 792 ath_rx_cleanup(sc);
794 ath_tx_cleanup(sc); 793 ath_tx_cleanup(sc);
795 ath9k_deinit_softc(sc); 794 ath9k_deinit_softc(sc);
795 kfree(sc->sec_wiphy);
796} 796}
797 797
798void ath_descdma_cleanup(struct ath_softc *sc, 798void ath_descdma_cleanup(struct ath_softc *sc,
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 56d4a93cd8e5..d45cf0b5db05 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1269,6 +1269,7 @@ static void ath9k_stop(struct ieee80211_hw *hw)
1269 struct ath_softc *sc = aphy->sc; 1269 struct ath_softc *sc = aphy->sc;
1270 struct ath_hw *ah = sc->sc_ah; 1270 struct ath_hw *ah = sc->sc_ah;
1271 struct ath_common *common = ath9k_hw_common(ah); 1271 struct ath_common *common = ath9k_hw_common(ah);
1272 int i;
1272 1273
1273 mutex_lock(&sc->mutex); 1274 mutex_lock(&sc->mutex);
1274 1275
@@ -1281,7 +1282,12 @@ static void ath9k_stop(struct ieee80211_hw *hw)
1281 cancel_work_sync(&sc->paprd_work); 1282 cancel_work_sync(&sc->paprd_work);
1282 cancel_work_sync(&sc->hw_check_work); 1283 cancel_work_sync(&sc->hw_check_work);
1283 1284
1284 if (!sc->num_sec_wiphy) { 1285 for (i = 0; i < sc->num_sec_wiphy; i++) {
1286 if (sc->sec_wiphy[i])
1287 break;
1288 }
1289
1290 if (i == sc->num_sec_wiphy) {
1285 cancel_delayed_work_sync(&sc->wiphy_work); 1291 cancel_delayed_work_sync(&sc->wiphy_work);
1286 cancel_work_sync(&sc->chan_work); 1292 cancel_work_sync(&sc->chan_work);
1287 } 1293 }