diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2013-11-07 11:48:05 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-11-11 11:15:29 +0100 |
commit | 8dabeb6a13b604cbc8e5f0321accf0fe5c5f4b63 (patch) | |
tree | 8c6f01e025071db8a8a12d14c608353fd06ca412 /commands | |
parent | 7c1091bd5895204b109c5a79996aa9367692a78a (diff) | |
download | barebox-8dabeb6a13b604cbc8e5f0321accf0fe5c5f4b63.tar.gz barebox-8dabeb6a13b604cbc8e5f0321accf0fe5c5f4b63.tar.xz |
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>
Diffstat (limited to 'commands')
-rw-r--r-- | commands/boot.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/commands/boot.c b/commands/boot.c index 91766e03be..c4b49a9035 100644 --- a/commands/boot.c +++ b/commands/boot.c @@ -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"); |