fbcon: Consistently protect deferred_takeover with console_lock()

[ Upstream commit 43553559121ca90965b572cf8a1d6d0fd618b449 ]

This shouldn't be a problem in practice since until we've actually
taken over the console there's nothing we've registered with the
console/vt subsystem, so the exit/unbind path that check this can't
do the wrong thing. But it's confusing, so fix it by moving it a tad
later.

Acked-by: Sam Ravnborg <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Du Cheng <[email protected]>
Cc: Tetsuo Handa <[email protected]>
Cc: Claudio Suarez <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
Daniel Vetter 2022-04-05 23:03:31 +02:00 • committed by Greg Kroah-Hartman
commit c7b41fd76c

View file

@ -3286,6 +3286,9 @@ static void fbcon_register_existing_fbs(struct work_struct *work)
console_lock();
deferred_takeover = false;
logo_shown = FBCON_LOGO_DONTSHOW;
for_each_registered_fb(i)
fbcon_fb_registered(registered_fb[i]);
@ -3303,8 +3306,6 @@ static int fbcon_output_notifier(struct notifier_block *nb,
pr_info("fbcon: Taking over console\n");
dummycon_unregister_output_notifier(&fbcon_output_nb);
deferred_takeover = false;
logo_shown = FBCON_LOGO_DONTSHOW;
/* We may get called in atomic context */
schedule_work(&fbcon_deferred_takeover_work);