diff options
author | Tom Rini <trini@konsulko.com> | 2025-08-01 17:59:07 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2025-08-01 17:59:07 -0600 |
commit | ae5711f881100f856ead1e76832c32b92dba93c7 (patch) | |
tree | 8fefd70d38b082b168d1ce3f3839ce202adf88a8 /env | |
parent | d0075e2d730a4fa48aa763a669e5edbc02c33a22 (diff) | |
parent | 7e842bd33154946052068195df3446635236d3d9 (diff) |
This series from Shiji Yang <yangshiji66@outlook.com> fixes some issues
with the recently added "environment in mtd (generic)" functionality.
Link: https://lore.kernel.org/r/OSBPR01MB1670E56647F1F8B4BA66A931BC59A@OSBPR01MB1670.jpnprd01.prod.outlook.com
Diffstat (limited to 'env')
-rw-r--r-- | env/mtd.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/env/mtd.c b/env/mtd.c index d7ec30e183a..b26ee80985a 100644 --- a/env/mtd.c +++ b/env/mtd.c @@ -131,6 +131,8 @@ static int env_mtd_save(void) puts("done\n"); done: + put_mtd_device(mtd_env); + if (saved_buf) free(saved_buf); @@ -188,6 +190,8 @@ static int env_mtd_load(void) gd->env_valid = ENV_VALID; out: + put_mtd_device(mtd_env); + free(buf); return ret; @@ -197,7 +201,7 @@ static int env_mtd_erase(void) { struct mtd_info *mtd_env; u32 sect_size, sect_num; - char *saved_buf, *tmp; + char *saved_buf = NULL, *tmp; struct erase_info ei; size_t ret_len; int remaining; @@ -280,6 +284,8 @@ static int env_mtd_erase(void) ret = 0; done: + put_mtd_device(mtd_env); + if (saved_buf) free(saved_buf); |