[PATCH] state: Fix error return value

Sascha Hauer s.hauer at pengutronix.de
Wed Apr 19 06:43:56 PDT 2017


When the backend phandle cannot be resolved we jump to the error
return path without initializing ret. Fix this.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 common/state/state.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/state/state.c b/common/state/state.c
index 8369aedac6..6db77f2c18 100644
--- a/common/state/state.c
+++ b/common/state/state.c
@@ -577,6 +577,7 @@ struct state *state_new_from_node(struct device_node *node, char *path,
 		partition_node = of_parse_phandle(node, "backend", 0);
 		if (!partition_node) {
 			dev_err(&state->dev, "Cannot resolve \"backend\" phandle\n");
+			ret = -EINVAL;
 			goto out_release_state;
 		}
 
-- 
2.11.0




More information about the barebox mailing list