aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--env/sf.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/env/sf.c b/env/sf.c
index 301bb32..102db82 100644
--- a/env/sf.c
+++ b/env/sf.c
@@ -155,6 +155,9 @@ static int env_sf_save(void)
#endif
done:
+ spi_flash_free(env_flash);
+ env_flash = NULL;
+
if (saved_buffer)
free(saved_buffer);
@@ -407,6 +410,9 @@ static int env_sf_init_early(void)
gd->env_addr = (unsigned long)&tmp_env1->data;
}
+ spi_flash_free(env_flash);
+ env_flash = NULL;
+
return 0;
err_read:
spi_flash_free(env_flash);