summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/if_udav.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_udav.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_udav.c')
-rw-r--r--sys/dev/usb/if_udav.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/dev/usb/if_udav.c b/sys/dev/usb/if_udav.c
index 690c9de..cd09046 100644
--- a/sys/dev/usb/if_udav.c
+++ b/sys/dev/usb/if_udav.c
@@ -378,6 +378,7 @@ USB_ATTACH(udav)
splx(s);
#elif defined(__FreeBSD__)
UDAV_UNLOCK(sc);
+ mtx_destroy(&sc->sc_mtx);
#endif
goto bad;
}
@@ -391,6 +392,7 @@ USB_ATTACH(udav)
if (ifp == NULL) {
printf("%s: can not if_alloc\n", devname);
UDAV_UNLOCK(sc);
+ mtx_destroy(&sc->sc_mtx);
goto bad;
}
#else
@@ -447,6 +449,7 @@ USB_ATTACH(udav)
if (mii_phy_probe(self, &sc->sc_miibus,
udav_ifmedia_change, udav_ifmedia_status)) {
printf("%s: MII without any PHY!\n", USBDEVNAME(sc->sc_dev));
+ if_free(ifp);
UDAV_UNLOCK(sc);
mtx_destroy(&sc->sc_mtx);
USB_ATTACH_ERROR_RETURN;
OpenPOWER on IntegriCloud