diff options
| author | christos <christos@NetBSD.org> | 2015-04-04 15:33:36 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2015-04-04 15:33:36 +0000 |
| commit | a40727ea1a1aa415f7d5b2f72d212a53b00276bb (patch) | |
| tree | 769fdc2e0b77d863eb6d0b874b976b9dffe86253 /sys/dev/usb | |
| parent | 558580bc2e74dce0abba15555b5b12f57263586b (diff) | |
fix leak, found by Brainy.
Diffstat (limited to 'sys/dev/usb')
| -rw-r--r-- | sys/dev/usb/umass_isdata.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/usb/umass_isdata.c b/sys/dev/usb/umass_isdata.c index ab8987032c1..39c1db399b6 100644 --- a/sys/dev/usb/umass_isdata.c +++ b/sys/dev/usb/umass_isdata.c @@ -1,4 +1,4 @@ -/* $NetBSD: umass_isdata.c,v 1.30 2014/09/12 16:40:38 skrll Exp $ */ +/* $NetBSD: umass_isdata.c,v 1.31 2015/04/04 15:33:36 christos Exp $ */ /* * TODO: @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: umass_isdata.c,v 1.30 2014/09/12 16:40:38 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: umass_isdata.c,v 1.31 2015/04/04 15:33:36 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -195,8 +195,11 @@ umass_isdata_attach(struct umass_softc *sc) USETW(req.wLength, sizeof *cf); err = usbd_do_request(sc->sc_udev, &req, cf); - if (err) - return (EIO); + if (err) { + sc->bus = NULL; + free(scbus, M_DEVBUF); + return EIO; + } DPRINTF(("umass_wd_attach info:\n EventNotification=0x%02x " "ExternalClock=0x%02x ATAInitTimeout=0x%02x\n" " ATAMisc1=0x%02x ATAMajorCommand=0x%02x " |
