summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/main.c
diff options
context:
space:
mode:
authorRajkumar Manoharan <rmanoharan@atheros.com>2010-07-08 12:12:29 +0530
committerJohn W. Linville <linville@tuxdriver.com>2010-07-14 13:52:45 -0400
commit447a42c2feb1091f217c1d50000d8cddf39addb5 (patch)
tree5a4066686fa0c3fdd803f65b974ab1d5c094d133 /drivers/net/wireless/ath/ath9k/main.c
parent6eb90d46c59a75ceeccfef7c6c6705fb64b593dc (diff)
downloadtalos-obmc-linux-447a42c2feb1091f217c1d50000d8cddf39addb5.tar.gz
talos-obmc-linux-447a42c2feb1091f217c1d50000d8cddf39addb5.zip
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>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/main.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c8
1 files changed, 7 insertions, 1 deletions
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)
struct ath_softc *sc = aphy->sc;
struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(ah);
+ int i;
mutex_lock(&sc->mutex);
@@ -1281,7 +1282,12 @@ static void ath9k_stop(struct ieee80211_hw *hw)
cancel_work_sync(&sc->paprd_work);
cancel_work_sync(&sc->hw_check_work);
- if (!sc->num_sec_wiphy) {
+ for (i = 0; i < sc->num_sec_wiphy; i++) {
+ if (sc->sec_wiphy[i])
+ break;
+ }
+
+ if (i == sc->num_sec_wiphy) {
cancel_delayed_work_sync(&sc->wiphy_work);
cancel_work_sync(&sc->chan_work);
}
OpenPOWER on IntegriCloud