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 17:33:09 -0400 |
commit | c2d00364c1d638eaa85d5f1384170f610b3c4beb (patch) | |
tree | f8b6f8e5e124451886d34d5bbe9d0cdd1725bdb6 /env | |
parent | 25d90ad45ab336bab6a21f0668b8c98a2939ff32 (diff) | |
download | u-boot-c2d00364c1d638eaa85d5f1384170f610b3c4beb.tar.gz u-boot-c2d00364c1d638eaa85d5f1384170f610b3c4beb.tar.bz2 u-boot-c2d00364c1d638eaa85d5f1384170f610b3c4beb.zip |
env: sf: add missing spi_flash_free
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>
Diffstat (limited to 'env')
-rw-r--r-- | env/sf.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -154,6 +154,9 @@ static int env_sf_save(void) printf("Valid environment: %d\n", (int)gd->env_valid); done: + spi_flash_free(env_flash); + env_flash = NULL; + if (saved_buffer) free(saved_buffer); @@ -255,6 +258,9 @@ static int env_sf_save(void) puts("done\n"); done: + spi_flash_free(env_flash); + env_flash = NULL; + if (saved_buffer) free(saved_buffer); @@ -413,6 +419,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); |