Module Name:    src
Committed By:   joerg
Date:           Sat Nov 26 03:19:42 UTC 2011

Modified Files:
        src/sys/dev/usb: umidi.c

Log Message:
Move KASSERT down to the point where the endpoint is known to exist.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/usb/umidi.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/umidi.c
diff -u src/sys/dev/usb/umidi.c:1.50 src/sys/dev/usb/umidi.c:1.51
--- src/sys/dev/usb/umidi.c:1.50	Sat Nov 26 03:14:25 2011
+++ src/sys/dev/usb/umidi.c	Sat Nov 26 03:19:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: umidi.c,v 1.50 2011/11/26 03:14:25 joerg Exp $	*/
+/*	$NetBSD: umidi.c,v 1.51 2011/11/26 03:19:42 joerg Exp $	*/
 /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umidi.c,v 1.50 2011/11/26 03:14:25 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umidi.c,v 1.51 2011/11/26 03:19:42 joerg Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -1148,11 +1148,11 @@ close_out_jack(struct umidi_jack *jack)
 	u_int16_t mask;
 	int err;
 
-	KASSERT(mutex_owned(&ep->sc->sc_lock));
 
 	if (jack->opened) {
 		ep = jack->endpoint;
 		sc = ep->sc;
+		KASSERT(mutex_owned(&sc->sc_lock));
 		mask = 1 << (jack->cable_number);
 		while (mask & (ep->this_schedule | ep->next_schedule)) {
 			err = cv_timedwait_sig(&sc->sc_cv, &sc->sc_lock,

Reply via email to