Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Restore interrupts on error path.



details:   https://anonhg.NetBSD.org/src/rev/47da15bc15fe
branches:  trunk
changeset: 340279:47da15bc15fe
user:      dholland <dholland%NetBSD.org@localhost>
date:      Sun Aug 30 04:27:03 2015 +0000

description:
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.

diffstat:

 sys/dev/ic/rrunner.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r 60ebaa84d310 -r 47da15bc15fe sys/dev/ic/rrunner.c
--- a/sys/dev/ic/rrunner.c      Sun Aug 30 04:17:48 2015 +0000
+++ b/sys/dev/ic/rrunner.c      Sun Aug 30 04:27:03 2015 +0000
@@ -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 @@
 
        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 @@
                error = tsleep((void *) &recv->ec_ulp, PCATCH | PRIBIO,
                               "eshfpopen", 0);
                if (error != 0 || recv->ec_index == -1) {
-                       splx(s);
                        goto bad_fp_ring_create;
                }
        }



Home | Main Index | Thread Index | Old Index