[PATCH] blspec: Fix another crash with menu disabled

Sascha Hauer s.hauer at pengutronix.de
Mon Nov 11 05:15:59 EST 2013


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 at 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 at 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 |



More information about the barebox mailing list