ath9k: set sc->sc_ah to NULL after freeing it
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Mon, 3 Aug 2009 19:24:53 +0000 (12:24 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 4 Aug 2009 20:44:32 +0000 (16:44 -0400)
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/main.c

index 91bffc91bbb03025ea8c0a883b67383ae4593b86..d3d2cb667dc665666b0170da6409fe1e49626e32 100644 (file)
@@ -1278,6 +1278,7 @@ void ath_detach(struct ath_softc *sc)
                        ath_tx_cleanupq(sc, &sc->tx.txq[i]);
 
        ath9k_hw_detach(sc->sc_ah);
+       sc->sc_ah = NULL;
        ath9k_exit_debug(sc);
 }
 
@@ -1521,6 +1522,7 @@ bad2:
 bad:
        if (ah)
                ath9k_hw_detach(ah);
+       sc->sc_ah = NULL;
 bad_no_ah:
        ath9k_exit_debug(sc);
 
@@ -1631,6 +1633,7 @@ error_attach:
                        ath_tx_cleanupq(sc, &sc->tx.txq[i]);
 
        ath9k_hw_detach(sc->sc_ah);
+       sc->sc_ah = NULL;
        ath9k_exit_debug(sc);
 
        return error;