mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: barebox@lists.infradead.org
Cc: "Jürgen Beisert" <jbe@pengutronix.de>
Subject: [PATCH] blspec: Fix another crash with menu disabled
Date: Thu,  7 Nov 2013 11:48:05 +0100	[thread overview]
Message-ID: <1383821285-28892-1-git-send-email-u.kleine-koenig@pengutronix.de> (raw)

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

             reply	other threads:[~2013-11-07 10:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-07 10:48 Uwe Kleine-König [this message]
2013-11-11 10:15 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1383821285-28892-1-git-send-email-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=jbe@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox