summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Grzeschik <m.grzeschik@pengutronix.de>2016-09-22 16:55:50 +0200
committerMichael Grzeschik <m.grzeschik@pengutronix.de>2016-09-22 16:56:52 +0200
commit29d2ac62e2c220fee94def3e993ef57fd5eb2114 (patch)
tree71b3daeb55489b79ec55f443d6958d7d421025b4
parentbbafbee71370bd78192ad6d874acb60bb6908f50 (diff)
downloaddt-utils-29d2ac62e2c220fee94def3e993ef57fd5eb2114.tar.gz
barebox-state: only set state->name by state->state if valid
This patch fixes commit d4c997a3. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
-rw-r--r--src/barebox-state.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/barebox-state.c b/src/barebox-state.c
index c2c1d32..07c516d 100644
--- a/src/barebox-state.c
+++ b/src/barebox-state.c
@@ -508,7 +508,7 @@ int main(int argc, char *argv[])
list_for_each_entry(state, &state_list.list, list) {
state->state = state_get(state->name, readonly);
- if (!state->name)
+ if (!IS_ERR(state->state) && !state->name)
state->name = state->state->name;
if (IS_ERR(state->state)) {
ret = 1;