discover/device-handler: Ignore options without kernel
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>
Wed, 6 Jul 2016 06:05:46 +0000 (16:05 +1000)
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>
Thu, 14 Jul 2016 01:25:27 +0000 (11:25 +1000)
All boot options must at least have a boot image; ignore any options
that do not before trying to resolve them.

Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
discover/device-handler.c

index cd4e3acba1bd0814f378771232a337309d391a2d..e230e7669ac31e3c4e04a35b35cf71be8155eb81 100644 (file)
@@ -1191,6 +1191,14 @@ void device_handler_discover_context_commit(struct device_handler *handler,
        list_for_each_entry_safe(&ctx->boot_options, opt, tmp, list) {
                list_remove(&opt->list);
 
+               /* All boot options need at least a kernel image */
+               if (!opt->boot_image || !opt->boot_image->url) {
+                       pb_log("boot option %s is missing boot image, ignoring\n",
+                               opt->option->id);
+                       talloc_free(opt);
+                       continue;
+               }
+
                if (boot_option_resolve(opt, handler)) {
                        pb_log("boot option %s is resolved, "
                                        "sending to clients\n",