[PATCH] state: Fix error return value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 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


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux