mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-08-06 15:26:58 +02:00
Merge patch series "env: mtd: add the missing put_mtd_device()"
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
This commit is contained in:
commit
ae5711f881
8
env/mtd.c
vendored
8
env/mtd.c
vendored
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user