]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
env: sf: Put ENV_INVALID into gd->env_valid on CRC failure
authorMarek Behún <marek.behun@nic.cz>
Fri, 22 Oct 2021 13:47:14 +0000 (15:47 +0200)
committerSimon Glass <sjg@chromium.org>
Sun, 31 Oct 2021 18:26:44 +0000 (12:26 -0600)
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 <marek.behun@nic.cz>
Reviewed-by: Simon Glass <sjg@chromium.org>
env/sf.c

index c251d076d7f796c63b07b5e8bb1a3becd5920dd7..6a4bb756f006136af19ab24f925c1612d994aad6 100644 (file)
--- 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;