* [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
* Re: [PATCH] blspec: Fix another crash with menu disabled
2013-11-07 10:48 [PATCH] blspec: Fix another crash with menu disabled Uwe Kleine-König
@ 2013-11-11 10:15 ` Sascha Hauer
0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2013-11-11 10:15 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: barebox, Jürgen Beisert
On Thu, Nov 07, 2013 at 11:48:05AM +0100, Uwe Kleine-König wrote:
> 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>
Applied, thanks
Sascha
> ---
> 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
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
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