diff options
Diffstat (limited to 'sys/dev/usb/usbf_subr.c')
-rw-r--r-- | sys/dev/usb/usbf_subr.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/usb/usbf_subr.c b/sys/dev/usb/usbf_subr.c index 711a08787a7..87b145ec2cc 100644 --- a/sys/dev/usb/usbf_subr.c +++ b/sys/dev/usb/usbf_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usbf_subr.c,v 1.12 2007/09/11 13:39:34 gilles Exp $ */ +/* $OpenBSD: usbf_subr.c,v 1.13 2008/06/10 20:50:19 miod Exp $ */ /* * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org> @@ -22,6 +22,7 @@ #include <sys/param.h> #include <sys/malloc.h> +#include <sys/proc.h> #include <sys/systm.h> #include <sys/timeout.h> @@ -87,6 +88,8 @@ usbf_realloc(void **pp, size_t *sizep, size_t newsize) oldsize = MIN(*sizep, newsize); if (oldsize > 0) bcopy(*pp, p, oldsize); + if (*pp != NULL) + free(*pp, M_USB); *pp = p; *sizep = newsize; return p; @@ -1041,7 +1044,8 @@ usbf_transfer_complete(usbf_xfer_handle xfer) pipe->methods->done(xfer); - /* XXX wake up any processes waiting for the transfer to complete */ + if (xfer->flags & USBD_SYNCHRONOUS) + wakeup(xfer); if (!repeat) { if (xfer->status != USBF_NORMAL_COMPLETION && |