9
0
Fork 0

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:
Uwe Kleine-König 2013-11-07 11:48:05 +01:00 committed by Sascha Hauer
parent 7c1091bd58
commit 8dabeb6a13
1 changed files with 3 additions and 1 deletions

View File

@ -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");