Module Name:    src
Committed By:   dholland
Date:           Sun Aug 30 04:27:03 UTC 2015

Modified Files:
        src/sys/dev/ic: rrunner.c

Log Message:
Restore interrupts on error path.

Also, on another path, avoid splx()'ing twice. While calling splx() a
second time with the same value has no further effect, it looks to me
like the first one of these calls is too early and some of the
subsequent operations are potential races. Not actually tested, I'm
afraid.

>From maxv's brainy list.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/dev/ic/rrunner.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/ic/rrunner.c
diff -u src/sys/dev/ic/rrunner.c:1.78 src/sys/dev/ic/rrunner.c:1.79
--- src/sys/dev/ic/rrunner.c:1.78	Fri Jul 25 08:10:37 2014
+++ src/sys/dev/ic/rrunner.c	Sun Aug 30 04:27:03 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: rrunner.c,v 1.78 2014/07/25 08:10:37 dholland Exp $	*/
+/*	$NetBSD: rrunner.c,v 1.79 2015/08/30 04:27:03 dholland Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rrunner.c,v 1.78 2014/07/25 08:10:37 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rrunner.c,v 1.79 2015/08/30 04:27:03 dholland Exp $");
 
 #include "opt_inet.h"
 
@@ -724,8 +724,10 @@ esh_fpopen(dev_t dev, int oflags, int de
 
 	if ((sc->sc_flags & ESH_FL_INITIALIZED) == 0) {
 		eshinit(sc);
-		if ((sc->sc_flags & ESH_FL_INITIALIZED) == 0)
+		if ((sc->sc_flags & ESH_FL_INITIALIZED) == 0) {
+			splx(s);
 			return EIO;
+		}
 	}
 
 	if ((sc->sc_flags & ESH_FL_RUNCODE_UP) == 0) {
@@ -867,7 +869,6 @@ esh_fpopen(dev_t dev, int oflags, int de
 		error = tsleep((void *) &recv->ec_ulp, PCATCH | PRIBIO,
 			       "eshfpopen", 0);
 		if (error != 0 || recv->ec_index == -1) {
-			splx(s);
 			goto bad_fp_ring_create;
 		}
 	}

Reply via email to