From: Marek BehĂșn Date: Wed, 3 Nov 2021 23:23:21 +0000 (+0100) Subject: env: Don't set ready flag if import failed in env_set_default() X-Git-Url: http://git.dujemihanovic.xyz/img/sics.gif?a=commitdiff_plain;h=c9db4c5440d760eedf80448d42559125ee1d0626;p=u-boot.git env: Don't set ready flag if import failed in env_set_default() 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 Reviewed-by: Simon Glass --- diff --git a/env/common.c b/env/common.c index 99729ca002..2aa23545ba 100644 --- a/env/common.c +++ b/env/common.c @@ -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;