From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oliver Dillinger Date: Fri, 22 Oct 2010 10:20:02 +0000 (UTC) Subject: [U-Boot] =?utf-8?q?=5BPATCH=5D_env=5Fsf_-_Do_not_free_flash_envir?= =?utf-8?q?onment_on_successful_read?= Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de In env_relocate_spec(), env_flash is freed and set to NULL if CONFIG_ENV_OFFSET_REDUND is undefined. This leads to an "Environment SPI flash not initialized" error when performing a saveenv. br, Oliver diff --git a/common/env_sf.c b/common/env_sf.c index fb0c39b..fc5f9f3 100644 --- a/common/env_sf.c +++ b/common/env_sf.c @@ -384,7 +384,10 @@ void env_relocate_spec(void) ret = env_import(buf, 1); if (ret) + { gd->env_valid = 1; + return; + } out: spi_flash_free(env_flash); env_flash = NULL;