Commit 9e409c47 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Petr Mladek

serial: kgdboc: Lock console list in probe function

Unprotected list walks are not necessarily safe.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarJohn Ogness <john.ogness@linutronix.de>
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
Reviewed-by: default avatarSergey Senozhatsky <senozhatsky@chromium.org>
Reviewed-by: default avatarPetr Mladek <pmladek@suse.com>
Reviewed-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20221116162152.193147-2-john.ogness@linutronix.de
parent 51f5f78a
...@@ -193,6 +193,7 @@ static int configure_kgdboc(void) ...@@ -193,6 +193,7 @@ static int configure_kgdboc(void)
if (!p) if (!p)
goto noconfig; goto noconfig;
console_lock();
for_each_console(cons) { for_each_console(cons) {
int idx; int idx;
if (cons->device && cons->device(cons, &idx) == p && if (cons->device && cons->device(cons, &idx) == p &&
...@@ -201,6 +202,7 @@ static int configure_kgdboc(void) ...@@ -201,6 +202,7 @@ static int configure_kgdboc(void)
break; break;
} }
} }
console_unlock();
kgdb_tty_driver = p; kgdb_tty_driver = p;
kgdb_tty_line = tty_line; kgdb_tty_line = tty_line;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment