From f230a37764a394409a1956579243589bf2e555d2 Mon Sep 17 00:00:00 2001 From: huhai Date: Fri, 18 Sep 2020 10:52:16 +0800 Subject: [PATCH] vt: fix used uninitialized variables This patch fix use uninitialized variable "old_rows" and "old_row_size" to initialize "old_screen_size". Signed-off-by: huhai --- drivers/tty/vt/vt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index fe991434c1cb4d..65b1812e353cce 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -1193,7 +1193,6 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc, new_rows = (lines ? lines : vc->vc_rows); new_row_size = new_cols << 1; new_screen_size = new_row_size * new_rows; - old_screen_size = old_rows * old_row_size; if (new_cols == vc->vc_cols && new_rows == vc->vc_rows) return 0; @@ -1219,6 +1218,7 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc, old_rows = vc->vc_rows; old_row_size = vc->vc_size_row; + old_screen_size = old_rows * old_row_size; err = resize_screen(vc, new_cols, new_rows, user); if (err) {