diff options
author | Patrick Delaunay <patrick.delaunay@foss.st.com> | 2021-02-24 11:52:35 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-04-16 12:08:28 -0400 |
commit | e20dac15714d00452147f091372480f7b521e0ea (patch) | |
tree | 507223595073449b189c52df70fefb2bb8875dd5 | |
parent | a5b112ba5915dddb58d564cc2b7be244daa4f0ac (diff) | |
download | u-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.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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); |