diff options
| author | dholland <dholland@NetBSD.org> | 2015-08-30 04:27:03 +0000 |
|---|---|---|
| committer | dholland <dholland@NetBSD.org> | 2015-08-30 04:27:03 +0000 |
| commit | ccc5a059710b0d83efb7440586f484ca5d53fa27 (patch) | |
| tree | 23d18810fd86e6ec375b91a8877e7d11ffe24877 /sys/dev/ic | |
| parent | 62e49f44ac32fef634356f3a819d9bf581adc352 (diff) | |
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 (limited to 'sys/dev/ic')
| -rw-r--r-- | sys/dev/ic/rrunner.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/ic/rrunner.c b/sys/dev/ic/rrunner.c index e9cc031c042..7fdf97ae2a4 100644 --- a/sys/dev/ic/rrunner.c +++ b/sys/dev/ic/rrunner.c @@ -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 devtype, 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 devtype, error = tsleep((void *) &recv->ec_ulp, PCATCH | PRIBIO, "eshfpopen", 0); if (error != 0 || recv->ec_index == -1) { - splx(s); goto bad_fp_ring_create; } } |
