Skip to content

Commit e2b3965

Browse files
jognesspmladek
authored andcommitted
tty: serial: kgdboc: use console_list_lock to trap exit
kgdboc_earlycon_init() uses the console_lock to ensure that no consoles are unregistered until the kgdboc_earlycon is setup. The console_list_lock should be used instead because list synchronization responsibility will be removed from the console_lock in a later change. Signed-off-by: John Ogness <[email protected]> Reviewed-by: Daniel Thompson <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Signed-off-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 6193bc9 commit e2b3965

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/tty/serial/kgdboc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -558,13 +558,13 @@ static int __init kgdboc_earlycon_init(char *opt)
558558
*/
559559

560560
/*
561-
* Hold the console_lock to guarantee that no consoles are
561+
* Hold the console_list_lock to guarantee that no consoles are
562562
* unregistered until the kgdboc_earlycon setup is complete.
563563
* Trapping the exit() callback relies on exit() not being
564564
* called until the trap is setup. This also allows safe
565565
* traversal of the console list and race-free reading of @flags.
566566
*/
567-
console_lock();
567+
console_list_lock();
568568
for_each_console(con) {
569569
if (con->write && con->read &&
570570
(con->flags & (CON_BOOT | CON_ENABLED)) &&
@@ -606,7 +606,7 @@ static int __init kgdboc_earlycon_init(char *opt)
606606
}
607607

608608
unlock:
609-
console_unlock();
609+
console_list_unlock();
610610

611611
/* Non-zero means malformed option so we always return zero */
612612
return 0;

0 commit comments

Comments
 (0)