Module Name:    src
Committed By:   skrll
Date:           Mon Dec 28 10:13:45 UTC 2015

Modified Files:
        src/sys/dev/usb [nick-nhusb]: usbdi.c

Log Message:
Drop/re-acquire the pipe lock when destroying up_intrxfer.  The fini
methods expect to be called unlocked.


To generate a diff of this commit:
cvs rdiff -u -r1.162.2.40 -r1.162.2.41 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.162.2.40 src/sys/dev/usb/usbdi.c:1.162.2.41
--- src/sys/dev/usb/usbdi.c:1.162.2.40	Mon Dec 28 09:26:33 2015
+++ src/sys/dev/usb/usbdi.c	Mon Dec 28 10:13:45 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbdi.c,v 1.162.2.40 2015/12/28 09:26:33 skrll Exp $	*/
+/*	$NetBSD: usbdi.c,v 1.162.2.41 2015/12/28 10:13:45 skrll 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.162.2.40 2015/12/28 09:26:33 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.162.2.41 2015/12/28 10:13:45 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -253,8 +253,13 @@ usbd_close_pipe(struct usbd_pipe *pipe)
 
 	LIST_REMOVE(pipe, up_next);
 	pipe->up_endpoint->ue_refcnt--;
-	if (pipe->up_intrxfer != NULL)
+
+	if (pipe->up_intrxfer != NULL) {
+	    	usbd_unlock_pipe(pipe);
 		usbd_destroy_xfer(pipe->up_intrxfer);
+		usbd_lock_pipe(pipe);
+	}
+
 	pipe->up_methods->upm_close(pipe);
 	usbd_unlock_pipe(pipe);
 	kmem_free(pipe, pipe->up_dev->ud_bus->ub_pipesize);

Reply via email to