]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
env: Don't set ready flag if import failed in env_set_default()
authorMarek Behún <marek.behun@nic.cz>
Wed, 3 Nov 2021 23:23:21 +0000 (00:23 +0100)
committerSimon Glass <sjg@chromium.org>
Sat, 13 Nov 2021 15:16:39 +0000 (08:16 -0700)
Do not set GD_FLG_ENV_READY nor GD_FLG_ENV_DEFAULT if failed importing
in env_set_default().

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Simon Glass <sjg@chromium.org>
env/common.c

index 99729ca002c2d8696a22b30a060d938629b1b440..2aa23545ba3d39c1226449f88052f6a5aeb62d1e 100644 (file)
@@ -261,9 +261,11 @@ void env_set_default(const char *s, int flags)
        flags |= H_DEFAULT;
        if (himport_r(&env_htab, default_environment,
                        sizeof(default_environment), '\0', flags, 0,
-                       0, NULL) == 0)
+                       0, NULL) == 0) {
                pr_err("## Error: Environment import failed: errno = %d\n",
                       errno);
+               return;
+       }
 
        gd->flags |= GD_FLG_ENV_READY;
        gd->flags |= GD_FLG_ENV_DEFAULT;