From e1d742f16487d4a59e06f998278f5b8a35b0d7e2 Mon Sep 17 00:00:00 2001 From: airjinkela <67526885+airjinkela@users.noreply.github.com> Date: Fri, 22 Aug 2025 09:46:49 +0800 Subject: [PATCH] env: mtd: add the missing put_mtd_device() (#135) --- uboot-mtk-20250711/env/mtd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/uboot-mtk-20250711/env/mtd.c b/uboot-mtk-20250711/env/mtd.c index d7ec30e18..ad263ed4b 100644 --- a/uboot-mtk-20250711/env/mtd.c +++ b/uboot-mtk-20250711/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; @@ -280,6 +284,8 @@ static int env_mtd_erase(void) ret = 0; done: + put_mtd_device(mtd_env); + if (saved_buf) free(saved_buf);