mirror of
https://github.com/torvalds/linux.git
synced 2026-11-28 17:32:32 +00:00
Instead of discarding the saved unicode buffer when the console was
resized while in the alternate screen, resize it to the current
dimensions using vc_uniscr_copy_area() to preserve its content. This
properly restores the unicode screen on alt screen exit rather than
lazily rebuilding it from a lossy reverse glyph translation.
On allocation failure the stale buffer is freed and vc_uni_lines is
set to NULL so it gets lazily rebuilt via vc_uniscr_check() when next
needed.
Fixes: 40014493ce ("vt: discard stale unicode buffer on alt screen exit after resize")
Cc: stable <[email protected]>
Signed-off-by: Nicolas Pitre <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>