Skip to content

Commit 903bd06

Browse files
jcfaraccorostedt
authored andcommitted
bootconfig: Fix missing return check of xbc_node_compose_key function
The function `xbc_show_list should` handle the keys during the composition. Even the errors returned by the compose function. Instead of removing the `ret` variable, it should save the value and show the exact error. This missing variable is causing a compilation issue also. Link: https://lkml.kernel.org/r/163077087861.222577.12884543474750968146.stgit@devnote2 Fixes: e5efaeb ("bootconfig: Support mixing a value and subkeys under a key") Signed-off-by: Julio Faracco <[email protected]> Acked-by: Masami Hiramatsu <[email protected]> Cc: [email protected] Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent 32ba9f0 commit 903bd06

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/bootconfig/main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,11 @@ static void xbc_show_list(void)
111111
char key[XBC_KEYLEN_MAX];
112112
struct xbc_node *leaf;
113113
const char *val;
114+
int ret;
114115

115116
xbc_for_each_key_value(leaf, val) {
116-
if (xbc_node_compose_key(leaf, key, XBC_KEYLEN_MAX) < 0) {
117+
ret = xbc_node_compose_key(leaf, key, XBC_KEYLEN_MAX);
118+
if (ret < 0) {
117119
fprintf(stderr, "Failed to compose key %d\n", ret);
118120
break;
119121
}

0 commit comments

Comments
 (0)