summaryrefslogtreecommitdiffstats
path: root/sys/dev/ath
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2004-04-02 23:47:39 +0000
committersam <sam@FreeBSD.org>2004-04-02 23:47:39 +0000
commit17ec9b5d0701f31e4ce2ce8dd39a94cc05834342 (patch)
tree1f36aa9a3289cd700e21d9b4d187b295b99cdf8d /sys/dev/ath
parent3711f03aeefbe8579d3ae75f13983bad8f5069fc (diff)
downloadFreeBSD-src-17ec9b5d0701f31e4ce2ce8dd39a94cc05834342.zip
FreeBSD-src-17ec9b5d0701f31e4ce2ce8dd39a94cc05834342.tar.gz
cleanup descriptor allocation if attach fails
Obtained from: madwifi
Diffstat (limited to 'sys/dev/ath')
-rw-r--r--sys/dev/ath/if_ath.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c
index 5c288e2..8f2cc85 100644
--- a/sys/dev/ath/if_ath.c
+++ b/sys/dev/ath/if_ath.c
@@ -288,7 +288,7 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
);
if (sc->sc_txhalq == (u_int) -1) {
if_printf(ifp, "unable to setup a data xmit queue!\n");
- goto bad;
+ goto bad2;
}
sc->sc_bhalq = ath_hal_setuptxqueue(ah,
HAL_TX_QUEUE_BEACON,
@@ -296,7 +296,7 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
);
if (sc->sc_bhalq == (u_int) -1) {
if_printf(ifp, "unable to setup a beacon xmit queue!\n");
- goto bad;
+ goto bad2;
}
ifp->if_softc = sc;
@@ -355,6 +355,8 @@ ath_attach(u_int16_t devid, struct ath_softc *sc)
sc->sc_rx_th.wr_ihdr.it_present = htole32(ATH_RX_RADIOTAP_PRESENT);
return 0;
+bad2:
+ ath_desc_free(sc);
bad:
if (ah)
ath_hal_detach(ah);
OpenPOWER on IntegriCloud