diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2014-02-09 13:21:49 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2014-02-09 13:21:49 +0000 |
commit | d49c4b622df7aacd900cb4b5bf2567867b7c0885 (patch) | |
tree | 217229911e47ad3d631ee6721a243c51a934f053 /sys/dev/usb | |
parent | 0edf19010294cdde1f1f17375d558fa6b658323d (diff) |
Make sure to close the default pipe before re-opening it when we want
to update the address and packet length, fixes a memory leak introduced
in revision 1.96.
Diffstat (limited to 'sys/dev/usb')
-rw-r--r-- | sys/dev/usb/usb_subr.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c index fd7a981dd95..c47f18a8b9e 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.97 2014/02/09 11:47:01 mpi Exp $ */ +/* $OpenBSD: usb_subr.c,v 1.98 2014/02/09 13:21:48 mpi 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 $ */ @@ -1162,7 +1162,7 @@ usbd_new_device(struct device *parent, struct usbd_bus *bus, int depth, USETW(dev->def_ep_desc.wMaxPacketSize, dd->bMaxPacketSize); /* Re-establish the default pipe with the new max packet size. */ - usbd_abort_pipe(dev->default_pipe); + usbd_close_pipe(dev->default_pipe); err = usbd_setup_pipe(dev, 0, &dev->def_ep, USBD_DEFAULT_INTERVAL, &dev->default_pipe); if (err) { @@ -1194,7 +1194,7 @@ usbd_new_device(struct device *parent, struct usbd_bus *bus, int depth, bus->devices[addr] = dev; /* Re-establish the default pipe with the new address. */ - usbd_abort_pipe(dev->default_pipe); + usbd_close_pipe(dev->default_pipe); err = usbd_setup_pipe(dev, 0, &dev->def_ep, USBD_DEFAULT_INTERVAL, &dev->default_pipe); if (err) { |