Module Name: src
Committed By: mlelstv
Date: Sat Oct 1 11:09:12 UTC 2016
Modified Files:
src/sys/dev/usb: if_run.c
Log Message:
Ignore completed transfers when detaching. This avoids a race condition
where the detach code has already freed the xfer structures.
To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/usb/if_run.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/if_run.c
diff -u src/sys/dev/usb/if_run.c:1.19 src/sys/dev/usb/if_run.c:1.20
--- src/sys/dev/usb/if_run.c:1.19 Sat Oct 1 11:07:30 2016
+++ src/sys/dev/usb/if_run.c Sat Oct 1 11:09:12 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: if_run.c,v 1.19 2016/10/01 11:07:30 mlelstv Exp $ */
+/* $NetBSD: if_run.c,v 1.20 2016/10/01 11:09:12 mlelstv Exp $ */
/* $OpenBSD: if_run.c,v 1.90 2012/03/24 15:11:04 jsg Exp $ */
/*-
@@ -23,7 +23,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_run.c,v 1.19 2016/10/01 11:07:30 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_run.c,v 1.20 2016/10/01 11:09:12 mlelstv Exp $");
#include <sys/param.h>
#include <sys/sockio.h>
@@ -2335,6 +2335,9 @@ run_rxeof(struct usbd_xfer *xfer, void *
uint32_t dmalen;
int xferlen;
+ if (__predict_false(sc->sc_flags & RUN_DETACHING))
+ return;
+
if (__predict_false(status != USBD_NORMAL_COMPLETION)) {
DPRINTF(("RX status=%d\n", status));
if (status == USBD_STALLED)