summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/if_aue.c
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2005-09-16 09:20:58 +0000
committerru <ru@FreeBSD.org>2005-09-16 09:20:58 +0000
commit985e35fdbaafacb128246b9c324b47382c1c525c (patch)
tree8b7a01cbb3e8eacf8697d0f292b60270e161bb4e /sys/dev/usb/if_aue.c
parentec39fdd014992d715023513c3f467183fe1ad7cb (diff)
downloadFreeBSD-src-985e35fdbaafacb128246b9c324b47382c1c525c.zip
FreeBSD-src-985e35fdbaafacb128246b9c324b47382c1c525c.tar.gz
Add missing mtx_destroy() when if_alloc() fails.
Add missing if_free() when mii_phy_probe() fails. Put if_free() into the correct #ifdef in detach().
Diffstat (limited to 'sys/dev/usb/if_aue.c')
-rw-r--r--sys/dev/usb/if_aue.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c
index 5112d7b..4793c4d 100644
--- a/sys/dev/usb/if_aue.c
+++ b/sys/dev/usb/if_aue.c
@@ -715,6 +715,10 @@ USB_ATTACH(aue)
ifp = sc->aue_ifp = if_alloc(IFT_ETHER);
if (ifp == NULL) {
printf("aue%d: can not if_alloc()\n", sc->aue_unit);
+ AUE_UNLOCK(sc);
+#if __FreeBSD_version >= 500000
+ mtx_destroy(&sc->aue_mtx);
+#endif
USB_ATTACH_ERROR_RETURN;
}
ifp->if_softc = sc;
@@ -745,6 +749,7 @@ USB_ATTACH(aue)
if (mii_phy_probe(self, &sc->aue_miibus,
aue_ifmedia_upd, aue_ifmedia_sts)) {
printf("aue%d: MII without any PHY!\n", sc->aue_unit);
+ if_free(ifp);
AUE_UNLOCK(sc);
#if __FreeBSD_version >= 500000
mtx_destroy(&sc->aue_mtx);
@@ -785,9 +790,9 @@ aue_detach(device_ptr_t dev)
untimeout(aue_tick, sc, sc->aue_stat_ch);
#if __FreeBSD_version >= 500000
ether_ifdetach(ifp);
+ if_free(ifp);
#else
ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
- if_free(ifp);
#endif
if (sc->aue_ep[AUE_ENDPT_TX] != NULL)
OpenPOWER on IntegriCloud