From af8149e9ac40dbb596fb2f5b72b82feb54476f68 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Beh=C3=BAn?= Date: Fri, 22 Oct 2021 15:47:14 +0200 Subject: [PATCH] env: sf: Put ENV_INVALID into gd->env_valid on CRC failure MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit env_sf_init_addr() says the environment is valid even if it is assigning default environment due to CRC failure. Change this to ENV_INVALID and let the generic env_init() function, which calls this initializer, assign the default environment. Signed-off-by: Marek Behún Reviewed-by: Simon Glass --- env/sf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/env/sf.c b/env/sf.c index c251d076d7..6a4bb756f0 100644 --- a/env/sf.c +++ b/env/sf.c @@ -341,8 +341,7 @@ static int env_sf_init_addr(void) gd->env_addr = (ulong)&(env_ptr->data); gd->env_valid = ENV_VALID; } else { - gd->env_addr = (ulong)&default_environment[0]; - gd->env_valid = ENV_VALID; + gd->env_valid = ENV_INVALID; } return 0; -- 2.39.5