loader: autoload_font will hung loader when there is no local console

If we start with console set to comconsole, the local
console (vidconsole, efi) is never initialized and attempt to
use the data can render the loader hung.

Reported by:	Kamigishi Rei
MFC after: 3 days
This commit is contained in:
Toomas Soome 2021-02-21 12:32:18 +02:00
parent f11e9f325a
commit 61c50cbc09
2 changed files with 9 additions and 2 deletions

View File

@ -886,6 +886,9 @@ cons_update_mode(bool use_gfx_mode)
EFI_STATUS status;
char env[10], *ptr;
if (!efi_started)
return (false);
/*
* Despite the use_gfx_mode, we want to make sure we call
* efi_find_framebuffer(). This will populate the fb data,

View File

@ -53,7 +53,7 @@ static int vidc_getchar(void);
static int vidc_ischar(void);
static void cons_draw_frame(teken_attr_t *);
static int vidc_started;
static bool vidc_started;
static uint16_t *vgatext;
static tf_bell_t vidc_cons_bell;
@ -877,6 +877,10 @@ cons_update_mode(bool use_gfx_mode)
char env[10], *ptr;
int format, roff, goff, boff;
/* vidc_init() is not called yet. */
if (!vidc_started)
return (false);
gfx_state.tg_tp.tp_row = TEXT_ROWS;
gfx_state.tg_tp.tp_col = TEXT_COLS;
@ -996,7 +1000,7 @@ vidc_init(int arg)
if (vidc_started && arg == 0)
return (0);
vidc_started = 1;
vidc_started = true;
vbe_init();
/*