summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2008-05-19 15:51:44 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2008-05-19 15:51:44 +0000
commit35778e7cd089d49062b347a407ef47d7b651fb0f (patch)
tree2ffd330377cfa7189af44facc203b07a9738b0cc /sys/dev
parent814839722b5de3be005fb62030e5e2a3f816e6b7 (diff)
do not leak memory if there is no power source. code is ifdef USB_DEBUG.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/usb_subr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c
index 928907f945f..f067dbb72ed 100644
--- a/sys/dev/usb/usb_subr.c
+++ b/sys/dev/usb/usb_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usb_subr.c,v 1.65 2008/05/19 14:05:43 fgsch Exp $ */
+/* $OpenBSD: usb_subr.c,v 1.66 2008/05/19 15:51:43 fgsch Exp $ */
/* $NetBSD: usb_subr.c,v 1.103 2003/01/10 11:19:13 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */
@@ -709,7 +709,8 @@ usbd_set_config_index(usbd_device_handle dev, int index, int msg)
#ifdef USB_DEBUG
if (dev->powersrc == NULL) {
DPRINTF(("usbd_set_config_index: No power source?\n"));
- return (USBD_IOERROR);
+ err = USBD_IOERROR;
+ goto bad;
}
#endif
power = cdp->bMaxPower * 2;