Skip to content

Commit fffb0b5

Browse files
committed
fbcon: set_con2fb_map needs to set con2fb_map!
I got really badly confused in d443d93 ("fbcon: move more common code into fb_open()") because we set the con2fb_map before the failure points, which didn't look good. But in trying to fix that I moved the assignment into the wrong path - we need to do it for _all_ vc we take over, not just the first one (which additionally requires the call to con2fb_acquire_newinfo). I've figured this out because of a KASAN bug report, where the fbcon_registered_fb and fbcon_display arrays went out of sync in fbcon_mode_deleted() because the con2fb_map pointed at the old fb_info, but the modes and everything was updated for the new one. Signed-off-by: Daniel Vetter <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Acked-by: Helge Deller <[email protected]> Tested-by: Xingyuan Mo <[email protected]> Fixes: d443d93 ("fbcon: move more common code into fb_open()") Reported-by: Xingyuan Mo <[email protected]> Cc: Thomas Zimmermann <[email protected]> Cc: Sam Ravnborg <[email protected]> Cc: Xingyuan Mo <[email protected]> Cc: Thomas Zimmermann <[email protected]> Cc: Helge Deller <[email protected]> Cc: <[email protected]> # v5.19+
1 parent edf79dd commit fffb0b5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/video/fbdev/core/fbcon.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,10 +846,11 @@ static int set_con2fb_map(int unit, int newidx, int user)
846846
if (err)
847847
return err;
848848

849-
con2fb_map[unit] = newidx;
850849
fbcon_add_cursor_work(info);
851850
}
852851

852+
con2fb_map[unit] = newidx;
853+
853854
/*
854855
* If old fb is not mapped to any of the consoles,
855856
* fbcon should release it.

0 commit comments

Comments
 (0)