diff options
Diffstat (limited to 'drivers/tty/vt/vt.c')
-rw-r--r-- | drivers/tty/vt/vt.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 06fb39c1d6dd..8c3bf3d613c0 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c | |||
@@ -870,10 +870,15 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc, | |||
870 | if (new_cols == vc->vc_cols && new_rows == vc->vc_rows) | 870 | if (new_cols == vc->vc_cols && new_rows == vc->vc_rows) |
871 | return 0; | 871 | return 0; |
872 | 872 | ||
873 | if (new_screen_size > (4 << 20)) | ||
874 | return -EINVAL; | ||
873 | newscreen = kmalloc(new_screen_size, GFP_USER); | 875 | newscreen = kmalloc(new_screen_size, GFP_USER); |
874 | if (!newscreen) | 876 | if (!newscreen) |
875 | return -ENOMEM; | 877 | return -ENOMEM; |
876 | 878 | ||
879 | if (vc == sel_cons) | ||
880 | clear_selection(); | ||
881 | |||
877 | old_rows = vc->vc_rows; | 882 | old_rows = vc->vc_rows; |
878 | old_row_size = vc->vc_size_row; | 883 | old_row_size = vc->vc_size_row; |
879 | 884 | ||
@@ -1176,7 +1181,7 @@ static void csi_J(struct vc_data *vc, int vpar) | |||
1176 | break; | 1181 | break; |
1177 | case 3: /* erase scroll-back buffer (and whole display) */ | 1182 | case 3: /* erase scroll-back buffer (and whole display) */ |
1178 | scr_memsetw(vc->vc_screenbuf, vc->vc_video_erase_char, | 1183 | scr_memsetw(vc->vc_screenbuf, vc->vc_video_erase_char, |
1179 | vc->vc_screenbuf_size >> 1); | 1184 | vc->vc_screenbuf_size); |
1180 | set_origin(vc); | 1185 | set_origin(vc); |
1181 | if (con_is_visible(vc)) | 1186 | if (con_is_visible(vc)) |
1182 | update_screen(vc); | 1187 | update_screen(vc); |