From: Jeremy Kerr Date: Thu, 10 Oct 2013 08:01:42 +0000 (+0800) Subject: discover: Allow device_handler_boot with no option X-Git-Tag: v1.0.0~390 X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=commitdiff_plain;h=769fd76dc9bf3440999297ab943af49160df9c45 discover: Allow device_handler_boot with no option Only call find_boot_option_by_id if we have an ID. Signed-off-by: Jeremy Kerr --- diff --git a/discover/device-handler.c b/discover/device-handler.c index 94abb51..142f6a4 100644 --- a/discover/device-handler.c +++ b/discover/device-handler.c @@ -650,9 +650,10 @@ static struct discover_boot_option *find_boot_option_by_id( void device_handler_boot(struct device_handler *handler, struct boot_command *cmd) { - struct discover_boot_option *opt; + struct discover_boot_option *opt = NULL; - opt = find_boot_option_by_id(handler, cmd->option_id); + if (cmd->option_id && strlen(cmd->option_id)) + opt = find_boot_option_by_id(handler, cmd->option_id); boot(handler, opt, cmd, handler->dry_run, boot_status, handler); }