ath9k: call ath9k_hw_detach() once upon hw init failure

If hw initialization fails (ath9k_hw_init()) on ath_init_softc()
we bail out and call ath9k_hw_detach(). The call ath9k_hw_detach()
is conditional though as ath9k_hw_init() could itself have called
ath9k_hw_detach(). Just describing this is itself a brain twister.
Avoid this nonsense by removing ath9k_hw_detach() from ath9k_hw_init().

Upon hw initialization failure we expect the callers to take care of
the cleanup.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Luis R. Rodriguez
2009-08-03 12:24:54 -07:00
committed by John W. Linville
parent 3ce1b1a949
commit 95fafca26d
2 changed files with 9 additions and 18 deletions

View File

@@ -1520,8 +1520,7 @@ bad2:
if (ATH_TXQ_SETUP(sc, i))
ath_tx_cleanupq(sc, &sc->tx.txq[i]);
bad:
if (ah)
ath9k_hw_detach(ah);
ath9k_hw_detach(ah);
sc->sc_ah = NULL;
bad_no_ah:
ath9k_exit_debug(sc);