Module Name: src
Committed By: aymeric
Date: Thu Jul 11 19:46:44 UTC 2013
Modified Files:
src/sys/dev/usb: usbdi.c
Log Message:
In usbd_transfer(), abort the xfer if it is interrupted by a signal while in
progress.
This prevents that xfer from being freed while still on queue, and ensuing
panic().
To generate a diff of this commit:
cvs rdiff -u -r1.153 -r1.154 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.153 src/sys/dev/usb/usbdi.c:1.154
--- src/sys/dev/usb/usbdi.c:1.153 Sat Jul 6 14:38:54 2013
+++ src/sys/dev/usb/usbdi.c Thu Jul 11 19:46:44 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: usbdi.c,v 1.153 2013/07/06 14:38:54 jakllsch Exp $ */
+/* $NetBSD: usbdi.c,v 1.154 2013/07/11 19:46:44 aymeric Exp $ */
/*
* Copyright (c) 1998, 2012 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.153 2013/07/06 14:38:54 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.154 2013/07/11 19:46:44 aymeric Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@@ -336,8 +336,10 @@ usbd_transfer(usbd_xfer_handle xfer)
else
err = tsleep(xfer, PRIBIO, "usbsyn", 0);
}
- if (err)
+ if (err) {
+ pipe->methods->abort(xfer);
break;
+ }
}
usbd_unlock_pipe(pipe);
return (xfer->status);