Check if yaboot.conf files are empty
authorGeoff Levand <geoffrey.levand@am.sony.com>
Sun, 12 Apr 2009 15:11:43 +0000 (15:11 +0000)
committerJeremy Kerr <jk@ozlabs.org>
Tue, 30 Jun 2009 07:29:10 +0000 (15:29 +0800)
Add a yaboot parser check to ignore empty yaboot.conf files.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
discover/yaboot-parser.c

index c47dee13c00189d0d9e3b71da9f018e78d3b7127..d9f2aff5924f6e250074722c97dff0deaa3a66de 100644 (file)
@@ -24,7 +24,12 @@ static void yaboot_finish(struct conf_context *conf)
 {
        struct yaboot_state *state = conf->parser_info;
 
-       assert(state->desc_image);
+       if (!state->desc_image) {
+               pb_log("%s: %s: no image found\n", __func__,
+                       conf->dc->device->id);
+               return;
+       }
+
        assert(state->opt);
        assert(state->opt->name);
        assert(state->opt->boot_args);