env: mtd: add the missing put_mtd_device() (#135)

This commit is contained in:
airjinkela
2025-08-22 09:46:49 +08:00
committed by GitHub
parent 2f1606ca8c
commit e1d742f164

View File

@@ -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);