Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tty: vt, fix bogus division in csi_J

In csi_J(3), the third parameter of scr_memsetw (vc_screenbuf_size) is
divided by 2 inappropriatelly. But scr_memsetw expects size, not
count, because it divides the size by 2 on its own before doing actual
memset-by-words.

So remove the bogus division.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Petr Písař <ppisar@redhat.com>
Fixes: f8df13e0a9 (tty: Clean console safely)
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby and committed by
Greg Kroah-Hartman
42acfc66 07d9a380

+1 -1
+1 -1
drivers/tty/vt/vt.c
··· 1176 1176 break; 1177 1177 case 3: /* erase scroll-back buffer (and whole display) */ 1178 1178 scr_memsetw(vc->vc_screenbuf, vc->vc_video_erase_char, 1179 - vc->vc_screenbuf_size >> 1); 1179 + vc->vc_screenbuf_size); 1180 1180 set_origin(vc); 1181 1181 if (con_is_visible(vc)) 1182 1182 update_screen(vc);