diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2017-10-09 08:16:14 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2017-10-09 08:16:14 +0000 |
commit | 3287fe8b0c4aebd76ea12c0a3be430ac3610f119 (patch) | |
tree | e283441e983c5b3026a20791bc33cbc7ca28bdbf | |
parent | 18a89c2381b76c744383b7a42147c2bcb9dfcc60 (diff) |
Make _kernel_lock_held() always succeed after panic(9).
ok visa@
-rw-r--r-- | sys/kern/kern_lock.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index c2f293de792..3bda382d569 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_lock.c,v 1.49 2017/04/20 15:06:47 visa Exp $ */ +/* $OpenBSD: kern_lock.c,v 1.50 2017/10/09 08:16:13 mpi Exp $ */ /* * Copyright (c) 1995 @@ -85,6 +85,8 @@ _kernel_unlock(void) int _kernel_lock_held(void) { + if (panicstr) + return 1; return (__mp_lock_held(&kernel_lock)); } |