blspec: Fix another crash with menu disabled
boot -l crashes with CONFIG_MENU disabled because blspec_alloc returns with blspec->menu being NULL in this case. So guard the usage of blspec->menu accordingly. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
7c1091bd58
commit
8dabeb6a13
|
@ -216,7 +216,9 @@ static struct blspec *bootentries_collect(char *entries[], int num_entries)
|
|||
int i;
|
||||
|
||||
blspec = blspec_alloc();
|
||||
blspec->menu->display = asprintf("boot");
|
||||
|
||||
if (IS_ENABLED(CONFIG_MENU))
|
||||
blspec->menu->display = asprintf("boot");
|
||||
|
||||
if (!num_entries)
|
||||
bootscript_scan_path(blspec, "/env/boot");
|
||||
|
|
Loading…
Reference in New Issue