Skip to content

Commit fc702e7

Browse files
ea1davisgregkh
authored andcommitted
vt: move vc_saved_screen to within tty allocated judgment
Everything starts with the assumption that a tty has been allocated. Therefore, Move it to within the tty allocation check. Fixes: 23743ba ("vt: add support for smput/rmput escape codes") Reported-by: syzbot+f6cb41c144427dc0796a@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=f6cb41c144427dc0796a Tested-by: syzbot+f6cb41c144427dc0796a@syzkaller.appspotmail.com Signed-off-by: Edward Adam Davis <eadavis@qq.com> Reviewed-by: Jiri Slaby <jirislaby@kernel.org> Link: https://lore.kernel.org/r/tencent_CAD45DB31906CF890DBB25AB0DED12205D07@qq.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent e817838 commit fc702e7

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/tty/vt/vt.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,10 +1341,10 @@ struct vc_data *vc_deallocate(unsigned int currcons)
13411341
vc_uniscr_set(vc, NULL);
13421342
kfree(vc->vc_screenbuf);
13431343
vc_cons[currcons].d = NULL;
1344-
}
1345-
if (vc->vc_saved_screen != NULL) {
1346-
kfree(vc->vc_saved_screen);
1347-
vc->vc_saved_screen = NULL;
1344+
if (vc->vc_saved_screen != NULL) {
1345+
kfree(vc->vc_saved_screen);
1346+
vc->vc_saved_screen = NULL;
1347+
}
13481348
}
13491349
return vc;
13501350
}

0 commit comments

Comments
 (0)