From 769fd76dc9bf3440999297ab943af49160df9c45 Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Thu, 10 Oct 2013 16:01:42 +0800 Subject: 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 --- discover/device-handler.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'discover') 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); } -- cgit v1.2.1