提交 42acfc66 编写于 作者: J Jiri Slaby 提交者: Greg Kroah-Hartman

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: NJiri Slaby <jslaby@suse.cz>
Cc: Petr Písař <ppisar@redhat.com>
Fixes: f8df13e0 (tty: Clean console safely)
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 07d9a380
...@@ -1176,7 +1176,7 @@ static void csi_J(struct vc_data *vc, int vpar) ...@@ -1176,7 +1176,7 @@ static void csi_J(struct vc_data *vc, int vpar)
break; break;
case 3: /* erase scroll-back buffer (and whole display) */ case 3: /* erase scroll-back buffer (and whole display) */
scr_memsetw(vc->vc_screenbuf, vc->vc_video_erase_char, scr_memsetw(vc->vc_screenbuf, vc->vc_video_erase_char,
vc->vc_screenbuf_size >> 1); vc->vc_screenbuf_size);
set_origin(vc); set_origin(vc);
if (con_is_visible(vc)) if (con_is_visible(vc))
update_screen(vc); update_screen(vc);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册