From 5cc5f799f241b39a3d4fd78e50eaed444c37742c Mon Sep 17 00:00:00 2001 From: mpi Date: Thu, 8 May 2014 14:00:52 +0000 Subject: [PATCH] Plug one more xfer leak. Now that aborting interrupt pipes does not prevent us from freeing the associated xfer, make sure to flag this xfer as "done" even if there's no need to abort it in hardware. --- sys/dev/usb/ehci.c | 5 ++++- sys/dev/usb/uhci.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/ehci.c b/sys/dev/usb/ehci.c index 5351d946182..98c5f83dcaf 100644 --- a/sys/dev/usb/ehci.c +++ b/sys/dev/usb/ehci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ehci.c,v 1.151 2014/05/04 14:42:36 mpi Exp $ */ +/* $OpenBSD: ehci.c,v 1.152 2014/05/08 14:00:52 mpi Exp $ */ /* $NetBSD: ehci.c,v 1.66 2004/06/30 03:11:56 mycroft Exp $ */ /* @@ -2734,6 +2734,9 @@ ehci_abort_xfer(struct usbd_xfer *xfer, usbd_status status) xfer->status = status; /* make software ignore it */ timeout_del(&xfer->timeout_handle); usb_rem_task(xfer->device, &xfer->abort_task); +#ifdef DIAGNOSTIC + ex->isdone = 1; +#endif usb_transfer_complete(xfer); splx(s); return; diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c index 7fe63f9c6c1..b720b39eb74 100644 --- a/sys/dev/usb/uhci.c +++ b/sys/dev/usb/uhci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhci.c,v 1.114 2014/05/04 14:42:36 mpi Exp $ */ +/* $OpenBSD: uhci.c,v 1.115 2014/05/08 14:00:52 mpi Exp $ */ /* $NetBSD: uhci.c,v 1.172 2003/02/23 04:19:26 simonb Exp $ */ /* $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $ */ @@ -1785,6 +1785,9 @@ uhci_abort_xfer(struct usbd_xfer *xfer, usbd_status status) xfer->status = status; /* make software ignore it */ timeout_del(&xfer->timeout_handle); usb_rem_task(xfer->device, &xfer->abort_task); +#ifdef DIAGNOSTIC + ux->isdone = 1; +#endif usb_transfer_complete(xfer); splx(s); return; -- 2.20.1