Module Name: src
Committed By: riastradh
Date: Sat Jun 12 13:57:40 UTC 2021
Modified Files:
src/sys/dev/usb: usbdi.c
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.204 -r1.205 src/sys/dev/usb/usbdi.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/usb/usbdi.c
diff -u src/sys/dev/usb/usbdi.c:1.204 src/sys/dev/usb/usbdi.c:1.205
--- src/sys/dev/usb/usbdi.c:1.204 Wed Aug 19 02:19:07 2020
+++ src/sys/dev/usb/usbdi.c Sat Jun 12 13:57:40 2021
@@ -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;