U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] env_sf - Do not free flash environment on successful read
@ 2010-10-22 10:20 Oliver Dillinger
  2010-10-22 10:56 ` Wolfgang Denk
  0 siblings, 1 reply; 4+ messages in thread
From: Oliver Dillinger @ 2010-10-22 10:20 UTC (permalink / raw)
  To: u-boot

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;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-10-22 12:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-22 10:20 [U-Boot] [PATCH] env_sf - Do not free flash environment on successful read Oliver Dillinger
2010-10-22 10:56 ` Wolfgang Denk
2010-10-22 11:48   ` Stefano Babic
2010-10-22 12:07     ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox