[PATCH v4 06/11] console/braille: Lock console->setup() call during the registration
From: Petr Mladek
Date: Thu Jun 04 2026 - 06:22:53 EST
In braille_register_console(), the console->setup() callback must be
called while holding the console_lock. This prevents a race condition
with a possible active boot console that might be using the same hardware
registers.
This applies the same protection to the braille console registration
that was introduced for regular console registration in commit 801410b26a0e
("serial: Lock console when calling into driver before registration").
Reported-by: Sashiko <sashiko-bot@xxxxxxxxxx>
Closes: https://sashiko.dev/#/patchset/20260423130015.85175-1-pmladek%40suse.com
Assisted-by: Gemini:gemini-3
Signed-off-by: Petr Mladek <pmladek@xxxxxxxx>
---
drivers/accessibility/braille/braille_console.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/accessibility/braille/braille_console.c b/drivers/accessibility/braille/braille_console.c
index 7b324329882f..9ed3abffb687 100644
--- a/drivers/accessibility/braille/braille_console.c
+++ b/drivers/accessibility/braille/braille_console.c
@@ -356,7 +356,9 @@ int braille_register_console(struct console *console, int index,
if (braille_co)
return -ENODEV;
if (console->setup) {
+ console_lock();
ret = console->setup(console, console_options);
+ console_unlock();
if (ret != 0)
return ret;
}
--
2.54.0