aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorAndy Shevchenko <[email protected]>2020-02-03 15:31:29 +0200
committerPetr Mladek <[email protected]>2020-02-11 10:44:17 +0100
commite78bedbd42b7caa65551f3d56cbff451ccbd0aee (patch)
tree4d4c53cf8b02afe554c90da41d32290af97c40ed /kernel
parentbb72e3981d8e7bb80db7cebc57a4e10769a509c9 (diff)
console: Don't notify user space when unregister non-listed console
If console is not on the list then there is nothing for us to do and sysfs notify is pointless. Note, that nr_ext_console_drivers is being changed only for listed consoles. Suggested-by: Sergey Senozhatsky <[email protected]> Link: http://lkml.kernel.org/r/[email protected] To: [email protected] To: Steven Rostedt <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Sergey Senozhatsky <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Signed-off-by: Petr Mladek <[email protected]>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/printk/printk.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 61d188f4c672..f435a17ef988 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2836,7 +2836,10 @@ int unregister_console(struct console *console)
}
}
- if (!res && (console->flags & CON_EXTENDED))
+ if (res)
+ goto out_disable_unlock;
+
+ if (console->flags & CON_EXTENDED)
nr_ext_console_drivers--;
/*
@@ -2849,6 +2852,13 @@ int unregister_console(struct console *console)
console->flags &= ~CON_ENABLED;
console_unlock();
console_sysfs_notify();
+
+ return res;
+
+out_disable_unlock:
+ console->flags &= ~CON_ENABLED;
+ console_unlock();
+
return res;
}
EXPORT_SYMBOL(unregister_console);