From 17b7d8a1eba4dc43099d01390bcf8922b0bd4549 Mon Sep 17 00:00:00 2001 From: imp Date: Wed, 21 Mar 2018 14:47:12 +0000 Subject: [PATCH] Unlock giant when calling shutdown_nice() --- sys/dev/syscons/syscons.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index 2020436d89bf..c5eed2309c9f 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -3858,22 +3858,28 @@ next_code: case RBT: #ifndef SC_DISABLE_REBOOT - if (enable_reboot && !(flags & SCGETC_CN)) + if (enable_reboot && !(flags & SCGETC_CN)) { + mtx_unlock(&Giant); shutdown_nice(0); + } #endif break; case HALT: #ifndef SC_DISABLE_REBOOT - if (enable_reboot && !(flags & SCGETC_CN)) + if (enable_reboot && !(flags & SCGETC_CN)) { + mtx_unlock(&Giant); shutdown_nice(RB_HALT); + } #endif break; case PDWN: #ifndef SC_DISABLE_REBOOT - if (enable_reboot && !(flags & SCGETC_CN)) + if (enable_reboot && !(flags & SCGETC_CN)) { + mtx_unlock(&Giant); shutdown_nice(RB_HALT|RB_POWEROFF); + } #endif break;