Module Name: src
Committed By: cegger
Date: Tue Jul 17 10:33:46 UTC 2012
Modified Files:
src/sys/dev/usb: usb.c
Log Message:
revert previous. testing queue number requires lock held.
To generate a diff of this commit:
cvs rdiff -u -r1.131 -r1.132 src/sys/dev/usb/usb.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/usb.c
diff -u src/sys/dev/usb/usb.c:1.131 src/sys/dev/usb/usb.c:1.132
--- src/sys/dev/usb/usb.c:1.131 Tue Jul 17 10:18:43 2012
+++ src/sys/dev/usb/usb.c Tue Jul 17 10:33:46 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: usb.c,v 1.131 2012/07/17 10:18:43 cegger Exp $ */
+/* $NetBSD: usb.c,v 1.132 2012/07/17 10:33:46 cegger Exp $ */
/*
* Copyright (c) 1998, 2002, 2008, 2012 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usb.c,v 1.131 2012/07/17 10:18:43 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb.c,v 1.132 2012/07/17 10:33:46 cegger Exp $");
#include "opt_compat_netbsd.h"
#include "opt_usb.h"
@@ -364,13 +364,12 @@ usb_rem_task(usbd_device_handle dev, str
{
struct usb_taskq *taskq;
- if (task->queue == -1)
- return;
-
taskq = &usb_taskq[task->queue];
mutex_enter(&taskq->lock);
- TAILQ_REMOVE(&taskq->tasks, task, next);
- task->queue = -1;
+ if (task->queue != -1) {
+ TAILQ_REMOVE(&taskq->tasks, task, next);
+ task->queue = -1;
+ }
mutex_exit(&taskq->lock);
}