Skip to content

Commit

Permalink
ath9k: set sc->sc_ah to NULL after freeing it
Browse files Browse the repository at this point in the history
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Aug 4, 2009
1 parent 9db6b6a commit 3ce1b1a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/wireless/ath/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -1521,6 +1522,7 @@ static int ath_init_softc(u16 devid, struct ath_softc *sc)
bad:
if (ah)
ath9k_hw_detach(ah);
sc->sc_ah = NULL;
bad_no_ah:
ath9k_exit_debug(sc);

Expand Down Expand Up @@ -1631,6 +1633,7 @@ int ath_init_device(u16 devid, 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);

return error;
Expand Down

0 comments on commit 3ce1b1a

Please sign in to comment.