summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2021-06-12 13:57:40 +0000
committerriastradh <riastradh@NetBSD.org>2021-06-12 13:57:40 +0000
commitcf6a30c79e8508cf83de20fad4e578501d6bcc6f (patch)
tree241219575d6663249f6d9a90b500d21d9802f5ad /sys/dev
parent66a9e71b1aa5f90a04774d40542bed1c4282e46b (diff)
usb(4): Cancel and wait for async task on closing pipe.
XXX usbd_kill_pipe and usbd_close_pipe should not be copypasta; there should be only one instance of this logic.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/usbdi.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c
index 3c5c957c334..fd5452249c8 100644
--- a/sys/dev/usb/usbdi.c
+++ b/sys/dev/usb/usbdi.c
@@ -1,4 +1,4 @@
-/* $NetBSD: usbdi.c,v 1.204 2020/08/19 02:19:07 msaitoh Exp $ */
+/* $NetBSD: usbdi.c,v 1.205 2021/06/12 13:57:40 riastradh Exp $ */
/*
* Copyright (c) 1998, 2012, 2015 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.204 2020/08/19 02:19:07 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.205 2021/06/12 13:57:40 riastradh Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -327,6 +327,8 @@ usbd_close_pipe(struct usbd_pipe *pipe)
}
usbd_unlock_pipe(pipe);
+ usb_rem_task_wait(pipe->up_dev, &pipe->up_async_task, USB_TASKQ_DRIVER,
+ NULL);
kmem_free(pipe, pipe->up_dev->ud_bus->ub_pipesize);
return USBD_NORMAL_COMPLETION;