proc: consoles: use console_list_lock for list iteration
authorJohn Ogness <john.ogness@linutronix.de>
Wed, 16 Nov 2022 16:21:46 +0000 (17:27 +0106)
committerPetr Mladek <pmladek@suse.com>
Fri, 2 Dec 2022 10:25:02 +0000 (11:25 +0100)
commit28de287a95362f52489c5a3f90acfb2b99524dae
tree38aa242944eac0a28e2cc20d79a9a4be82b647e7
parent7c2af0f634f1bc761ca827310dc7e8e586af502f
proc: consoles: use console_list_lock for list iteration

The console_lock is used in part to guarantee safe list iteration.
The console_list_lock should be used because list synchronization
responsibility will be removed from the console_lock in a later
change.

Note, the console_lock is still needed to serialize the device()
callback with other console operations.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20221116162152.193147-35-john.ogness@linutronix.de
fs/proc/consoles.c