env: mtd: add the missing put_mtd_device() (#135)
This commit is contained in:
6
uboot-mtk-20250711/env/mtd.c
vendored
6
uboot-mtk-20250711/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;
|
||||
@@ -280,6 +284,8 @@ static int env_mtd_erase(void)
|
||||
ret = 0;
|
||||
|
||||
done:
|
||||
put_mtd_device(mtd_env);
|
||||
|
||||
if (saved_buf)
|
||||
free(saved_buf);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user