From d4c997a3016a18033546766e9562baa1344cb981 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Wed, 14 Sep 2016 08:30:15 +0200 Subject: barebox-state: make sure state->name is valid It's used later while setting state variables. Fixes: feb64890a302 ("barebox-state: fall back to /state if there is no alias defined") Signed-off-by: Michael Olbrich --- src/barebox-state.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/barebox-state.c b/src/barebox-state.c index 64831df..c2c1d32 100644 --- a/src/barebox-state.c +++ b/src/barebox-state.c @@ -508,6 +508,8 @@ 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) + state->name = state->state->name; if (IS_ERR(state->state)) { ret = 1; goto out_unlock; -- cgit v1.2.3