summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2014-04-29 12:47:34 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2014-04-29 12:47:34 +0000
commit0fa030b5e0cc0ac80c9c2bc844598c870f75b56b (patch)
tree27e716d5365fa764e1fb3a6fc490bfc61e182452 /sys
parent7bdf8dcf18608902146dd3a3df571d30d795e099 (diff)
Plug an xfer leak.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/uhidev.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/sys/dev/usb/uhidev.c b/sys/dev/usb/uhidev.c
index 205fa8e9270..5f7cd0f968d 100644
--- a/sys/dev/usb/uhidev.c
+++ b/sys/dev/usb/uhidev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhidev.c,v 1.59 2014/04/24 09:40:28 mpi Exp $ */
+/* $OpenBSD: uhidev.c,v 1.60 2014/04/29 12:47:33 mpi Exp $ */
/* $NetBSD: uhidev.c,v 1.14 2003/03/11 16:44:00 augustss Exp $ */
/*
@@ -572,6 +572,10 @@ out1:
usbd_free_xfer(sc->sc_owxfer);
sc->sc_owxfer = NULL;
}
+ if (sc->sc_ixfer != NULL) {
+ usbd_free_xfer(sc->sc_ixfer);
+ sc->sc_ixfer = NULL;
+ }
return (error);
}
@@ -587,11 +591,20 @@ uhidev_close(struct uhidev *scd)
return;
DPRINTF(("uhidev_close: close pipe\n"));
- if (sc->sc_oxfer != NULL)
+ if (sc->sc_oxfer != NULL) {
usbd_free_xfer(sc->sc_oxfer);
+ sc->sc_oxfer = NULL;
+ }
- if (sc->sc_owxfer != NULL)
+ if (sc->sc_owxfer != NULL) {
usbd_free_xfer(sc->sc_owxfer);
+ sc->sc_owxfer = NULL;
+ }
+
+ if (sc->sc_ixfer != NULL) {
+ usbd_free_xfer(sc->sc_ixfer);
+ sc->sc_ixfer = NULL;
+ }
/* Disable interrupts. */
if (sc->sc_opipe != NULL) {