summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2007-02-03 19:11:09 +0000
committerimp <imp@FreeBSD.org>2007-02-03 19:11:09 +0000
commit0b64c14442149f8d92ce19be832187bcd11da451 (patch)
treef7217b95816e51818a0a52cf8ff49ccc614b2455 /sys/dev/usb
parent82ed1dbff8e188e81b203e009cb81f5ee12a7310 (diff)
downloadFreeBSD-src-0b64c14442149f8d92ce19be832187bcd11da451.zip
FreeBSD-src-0b64c14442149f8d92ce19be832187bcd11da451.tar.gz
It turns out we were mallocing too early, so move the allocation so we
don't leak.
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/uipaq.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/usb/uipaq.c b/sys/dev/usb/uipaq.c
index b83b7e4..2498b50 100644
--- a/sys/dev/usb/uipaq.c
+++ b/sys/dev/usb/uipaq.c
@@ -159,7 +159,6 @@ uipaq_attach(device_t self)
ucom->sc_dev = self;
ucom->sc_udev = dev;
- devinfop = malloc (1024, M_USBDEV, M_WAITOK);
DPRINTFN(10,("\nuipaq_attach: sc=%p\n", sc));
@@ -178,6 +177,11 @@ uipaq_attach(device_t self)
goto bad;
}
+ devinfop = malloc (1024, M_USBDEV, M_WAITOK);
+ if (devinfop == NULL) {
+ err = ENOMEM;
+ goto bad;
+ }
usbd_devinfo(dev, 0, devinfop);
ucom->sc_dev = self;
device_set_desc_copy(self, devinfop);
OpenPOWER on IntegriCloud