Module Name:    src
Committed By:   mlelstv
Date:           Tue Oct  2 23:10:35 UTC 2012

Modified Files:
        src/sys/kern: tty.c

Log Message:
Don't call ureadc() with a spinlock held because ureadc() may fault when
writing to userspace.


To generate a diff of this commit:
cvs rdiff -u -r1.254 -r1.255 src/sys/kern/tty.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/kern/tty.c
diff -u src/sys/kern/tty.c:1.254 src/sys/kern/tty.c:1.255
--- src/sys/kern/tty.c:1.254	Sun Sep 30 11:49:44 2012
+++ src/sys/kern/tty.c	Tue Oct  2 23:10:34 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: tty.c,v 1.254 2012/09/30 11:49:44 mlelstv Exp $	*/
+/*	$NetBSD: tty.c,v 1.255 2012/10/02 23:10:34 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tty.c,v 1.254 2012/09/30 11:49:44 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tty.c,v 1.255 2012/10/02 23:10:34 mlelstv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1957,7 +1957,9 @@ ttread(struct tty *tp, struct uio *uio, 
 		/*
 		 * Give user character.
 		 */
+		mutex_spin_exit(&tty_lock);
  		error = ureadc(c, uio);
+		mutex_spin_enter(&tty_lock);
 		if (error)
 			break;
  		if (uio->uio_resid == 0)

Reply via email to