* [PATCH] env: Fix invalid env handling in env_init()
@ 2020-05-29 17:51 Marek Vasut
0 siblings, 0 replies; only message in thread
From: Marek Vasut @ 2020-05-29 17:51 UTC (permalink / raw)
To: u-boot
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.
Signed-off-by: Marek Vasut <marex@denx.de>
---
env/env.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/env/env.c b/env/env.c
index dcc25c030b..024d36fdbe 100644
--- a/env/env.c
+++ b/env/env.c
@@ -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)
--
2.25.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-05-29 17:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-29 17:51 [PATCH] env: Fix invalid env handling in env_init() Marek Vasut
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.