[PATCH] sysrq: Restore original console_loglevel when sysrq disabled

From: Petr Mladek
Date: Fri Jan 11 2019 - 07:45:29 EST


The sysrq header line is printed with an increased loglevel
to provide users some positive feedback.

The original loglevel is not restored when the sysrq operation
is disabled. This bug was introduced in 2.6.12 (pre-git-history)
by the commit ("Allow admin to enable only some of the Magic-Sysrq
functions").

Signed-off-by: Petr Mladek <pmladek@xxxxxxxx>
---
drivers/tty/sysrq.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
index 1f03078ec352..2e4e184cfaa6 100644
--- a/drivers/tty/sysrq.c
+++ b/drivers/tty/sysrq.c
@@ -553,6 +553,7 @@ void __handle_sysrq(int key, bool check_mask)
op_p->handler(key);
} else {
pr_cont("This sysrq operation is disabled.\n");
+ console_loglevel = orig_log_level;
}
} else {
pr_cont("HELP : ");
--
2.13.7