summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/bootconfig.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/bootconfig.c b/lib/bootconfig.c
index 54ac623ca781..2ef304db31f2 100644
--- a/lib/bootconfig.c
+++ b/lib/bootconfig.c
@@ -581,7 +581,7 @@ static int __init __xbc_parse_keys(char *k)
static int __init xbc_parse_kv(char **k, char *v)
{
struct xbc_node *prev_parent = last_parent;
- struct xbc_node *node, *child;
+ struct xbc_node *child;
char *next;
int c, ret;
@@ -590,15 +590,18 @@ static int __init xbc_parse_kv(char **k, char *v)
return ret;
child = xbc_node_get_child(last_parent);
- if (child && xbc_node_is_key(child))
- return xbc_parse_error("Value is mixed with subkey", v);
+ if (child) {
+ if (xbc_node_is_key(child))
+ return xbc_parse_error("Value is mixed with subkey", v);
+ else
+ return xbc_parse_error("Value is redefined", v);
+ }
c = __xbc_parse_value(&v, &next);
if (c < 0)
return c;
- node = xbc_add_sibling(v, XBC_VALUE);
- if (!node)
+ if (!xbc_add_sibling(v, XBC_VALUE))
return -ENOMEM;
if (c == ',') { /* Array */