summaryrefslogtreecommitdiffstats
path: root/discover
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-12-10 08:54:17 +0800
committerJeremy Kerr <jk@ozlabs.org>2013-12-10 09:03:43 +0800
commit32e2eac76dcdc7b54454c9f3731496f8947cdbbc (patch)
tree000d05f7e139fde7a39d1a59781878ab8e601d32 /discover
parent6c40be15d13765c004e3568cd50b543e1fb74648 (diff)
downloadtalos-petitboot-32e2eac76dcdc7b54454c9f3731496f8947cdbbc.tar.gz
talos-petitboot-32e2eac76dcdc7b54454c9f3731496f8947cdbbc.zip
discover/yaboot: Fix assertion failure on empty yaboot files
yaboot configuration files with no option will cause an assertion failure (or segfault), as we unconditionally call yaboot_finish(). Check for the presence of an option in yaboot_finish() instead of asserting. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover')
-rw-r--r--discover/yaboot-parser.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/discover/yaboot-parser.c b/discover/yaboot-parser.c
index e52187f..f16ac72 100644
--- a/discover/yaboot-parser.c
+++ b/discover/yaboot-parser.c
@@ -102,7 +102,8 @@ static void yaboot_finish(struct conf_context *conf)
const char *default_label;
struct boot_option *opt;
- assert(state->opt);
+ if (!state->opt)
+ return;
opt = state->opt->option;
assert(opt);
OpenPOWER on IntegriCloud