mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] blspec: Fix another crash with menu disabled
@ 2013-11-07 10:48 Uwe Kleine-König
  2013-11-11 10:15 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Uwe Kleine-König @ 2013-11-07 10:48 UTC (permalink / raw)
  To: barebox; +Cc: Jürgen Beisert

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>
---
 commands/boot.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/commands/boot.c b/commands/boot.c
index 8105889..cce4c30 100644
--- a/commands/boot.c
+++ b/commands/boot.c
@@ -87,7 +87,10 @@ static struct blspec *bootentries_collect(void)
 	struct blspec *blspec;
 
 	blspec = blspec_alloc();
-	blspec->menu->display = asprintf("boot");
+
+	if (IS_ENABLED(CONFIG_MENU))
+		blspec->menu->display = asprintf("boot");
+
 	bootsources_menu_env_entries(blspec);
 	if (IS_ENABLED(CONFIG_BLSPEC))
 		blspec_scan_devices(blspec);
-- 
1.8.4.rc3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-11-11 10:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-07 10:48 [PATCH] blspec: Fix another crash with menu disabled Uwe Kleine-König
2013-11-11 10:15 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox