diff options
author | ru <ru@FreeBSD.org> | 2005-09-16 09:20:58 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2005-09-16 09:20:58 +0000 |
commit | 985e35fdbaafacb128246b9c324b47382c1c525c (patch) | |
tree | 8b7a01cbb3e8eacf8697d0f292b60270e161bb4e /sys/dev/usb/if_kue.c | |
parent | ec39fdd014992d715023513c3f467183fe1ad7cb (diff) | |
download | FreeBSD-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_kue.c')
-rw-r--r-- | sys/dev/usb/if_kue.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/usb/if_kue.c b/sys/dev/usb/if_kue.c index f8c9d95..7c5a700 100644 --- a/sys/dev/usb/if_kue.c +++ b/sys/dev/usb/if_kue.c @@ -478,6 +478,10 @@ USB_ATTACH(kue) ifp = sc->kue_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { printf("kue%d: can not if_alloc()\n", sc->kue_unit); + KUE_UNLOCK(sc); +#if __FreeBSD_version >= 500000 + mtx_destroy(&sc->kue_mtx); +#endif USB_ATTACH_ERROR_RETURN; } ifp->if_softc = sc; @@ -526,9 +530,9 @@ kue_detach(device_ptr_t dev) if (ifp != NULL) #if __FreeBSD_version >= 500000 ether_ifdetach(ifp); + if_free(ifp); #else ether_ifdetach(ifp, ETHER_BPF_SUPPORTED); - if_free(ifp); #endif if (sc->kue_ep[KUE_ENDPT_TX] != NULL) |