aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSujith <Sujith.Manoharan@atheros.com>2010-03-17 04:55:24 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-03-23 16:50:16 -0400
commit736b3a27b3c50c4a23717b802240435a69e8d0ff (patch)
tree31146e064aa07c32ce881e11a335f566e8cad367
parent05020d236e91ddab1cb42483843a8995b3be1adf (diff)
ath9k_hw: fix hardware deinit
Without this you will get a panic if the device initialization fails. Also, free ath_hw instance properly. ath9k_hw_deinit() shouldn't do it. Cc: stable@kernel.org Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c4
-rw-r--r--drivers/net/wireless/ath/ath9k/init.c3
2 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 05aeb511c686..77db932c3137 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1227,7 +1227,7 @@ void ath9k_hw_deinit(struct ath_hw *ah)
1227{ 1227{
1228 struct ath_common *common = ath9k_hw_common(ah); 1228 struct ath_common *common = ath9k_hw_common(ah);
1229 1229
1230 if (common->state <= ATH_HW_INITIALIZED) 1230 if (common->state < ATH_HW_INITIALIZED)
1231 goto free_hw; 1231 goto free_hw;
1232 1232
1233 if (!AR_SREV_9100(ah)) 1233 if (!AR_SREV_9100(ah))
@@ -1238,8 +1238,6 @@ void ath9k_hw_deinit(struct ath_hw *ah)
1238free_hw: 1238free_hw:
1239 if (!AR_SREV_9280_10_OR_LATER(ah)) 1239 if (!AR_SREV_9280_10_OR_LATER(ah))
1240 ath9k_hw_rf_free_ext_banks(ah); 1240 ath9k_hw_rf_free_ext_banks(ah);
1241 kfree(ah);
1242 ah = NULL;
1243} 1241}
1244EXPORT_SYMBOL(ath9k_hw_deinit); 1242EXPORT_SYMBOL(ath9k_hw_deinit);
1245 1243
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index 623c2f884987..6063f5463708 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -758,6 +758,9 @@ static void ath9k_deinit_softc(struct ath_softc *sc)
758 758
759 tasklet_kill(&sc->intr_tq); 759 tasklet_kill(&sc->intr_tq);
760 tasklet_kill(&sc->bcon_tasklet); 760 tasklet_kill(&sc->bcon_tasklet);
761
762 kfree(sc->sc_ah);
763 sc->sc_ah = NULL;
761} 764}
762 765
763void ath9k_deinit_device(struct ath_softc *sc) 766void ath9k_deinit_device(struct ath_softc *sc)