libpayload: Don't try to use invalid row count

console->scroll_up() was hanging when console->rows is 0.  This
was happening on delan if no screen was attached.  If there are no
rows, just return.

BUG=b:119234919
TEST=Boot delan with no flat panel.  System boots to OS

Change-Id: Ib022d3c6fc0c9cf360809dca28761a50c787304a
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://review.coreboot.org/c/30092
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
This commit is contained in:
Martin Roth 2018-12-06 15:11:52 -07:00 committed by Patrick Georgi
parent ffe4aededf
commit 3a2aa45eeb
1 changed files with 3 additions and 0 deletions

View File

@ -87,6 +87,9 @@ static void video_console_fixup_cursor(void)
cursory++; cursory++;
} }
if (console->rows <= 0)
return;
while(cursory >= console->rows) { while(cursory >= console->rows) {
console->scroll_up(); console->scroll_up();
cursory--; cursory--;