X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=discover%2Fboot.c;h=5ca69b9f135f3cdbc032ccd7168311685e3adf5a;hb=c75acc64833eb7263b340079e7ba3153ebc60aec;hp=29aefa916a8e149b973c69baccbb52b6a6bef799;hpb=ee329cc09cfbeefac95efeda31bb9ef839dd1382;p=petitboot diff --git a/discover/boot.c b/discover/boot.c index 29aefa9..5ca69b9 100644 --- a/discover/boot.c +++ b/discover/boot.c @@ -140,7 +140,7 @@ int boot(void *ctx, struct discover_boot_option *opt, struct boot_command *cmd, initrd = NULL; args = NULL; - if (cmd->boot_image_file) { + if (cmd && cmd->boot_image_file) { image = pb_url_parse(opt, cmd->boot_image_file); } else if (opt && opt->boot_image) { image = opt->boot_image->url; @@ -149,13 +149,13 @@ int boot(void *ctx, struct discover_boot_option *opt, struct boot_command *cmd, return -1; } - if (cmd->initrd_file) { + if (cmd && cmd->initrd_file) { initrd = pb_url_parse(opt, cmd->initrd_file); } else if (opt && opt->initrd) { initrd = opt->initrd->url; } - if (cmd->boot_args) { + if (cmd && cmd->boot_args) { args = talloc_strdup(ctx, cmd->boot_args); } else if (opt && opt->option->boot_args) { args = talloc_strdup(ctx, opt->option->boot_args);