aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Delaunay <patrick.delaunay@foss.st.com>2021-02-24 11:52:35 +0100
committerTom Rini <trini@konsulko.com>2021-04-16 12:08:28 -0400
commite20dac15714d00452147f091372480f7b521e0ea (patch)
tree507223595073449b189c52df70fefb2bb8875dd5
parenta5b112ba5915dddb58d564cc2b7be244daa4f0ac (diff)
downloadu-boot-WIP/2021-04-16-env-updates.zip
u-boot-WIP/2021-04-16-env-updates.tar.gz
u-boot-WIP/2021-04-16-env-updates.tar.bz2
env: sf: add missing spi_flash_freeWIP/2021-04-16-env-updates
Free the SPI resources by calling spi_flash_free() in each env sf function to avoid issue for other SPI users. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
-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);