summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-04-19 14:34:30 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2017-04-19 15:43:51 +0200
commitd11584df3d8c311f8d12a16badc8fbe18e592f87 (patch)
tree190342260080a333525d177fbd460f54307d827c
parentf7f947e0d6e3a841310ce4991240e1f496696ce1 (diff)
downloadbarebox-d11584df3d8c311f8d12a16badc8fbe18e592f87.tar.gz
state: Fix error return value
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@pengutronix.de>
-rw-r--r--common/state/state.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/common/state/state.c b/common/state/state.c
index 8369aed..6db77f2 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;
}