Skip to contentSkip to conversation

env: Fix invalid env handling in env_init()

PATCH Superseded Marek Vasut 1 participant 1 message May 29, 2020

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 env: Fix invalid env handling in env_init()

In case the env storage driver marks environment as ENV_INVALID, we must reset the $ret return value to -ENOENT to let the env init code reset the environment to the default one a bit further down.

---
 env/env.c | 3 +++
 1 file changed, 3 insertions(+)
env/env.c +3 -0
index dcc25c030b..024d36fdbe 100644
@@ -300,6 +300,9 @@ int env_init(void)
 
 		debug("%s: Environment %s init done (ret=%d)\n", __func__,
 		      drv->name, ret);
+
+		if (gd->env_valid == ENV_INVALID)
+			ret = -ENOENT;
 	}
 
 	if (!prio)
Signature · 1 line
2.25.1