summaryrefslogtreecommitdiff
path: root/env/mtd.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2025-05-26 16:07:19 -0600
committerTom Rini <trini@konsulko.com>2025-05-26 16:07:19 -0600
commit39b815d02d7ce6af32bcf023d20243c404b75a84 (patch)
tree68cd13fa83e90f69bf8c989fbcde768b676eb6d7 /env/mtd.c
parentbab54f5942c428be698216224fd10b91d974d4da (diff)
parent2ca1398a5ece8d33d8feb6b410e6e38588b5d2bc (diff)
Merge tag 'v2025.07-rc3' into next
Prepare v2025.07-rc3
Diffstat (limited to 'env/mtd.c')
-rw-r--r--env/mtd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/env/mtd.c b/env/mtd.c
index 721faebd8f2..d7ec30e183a 100644
--- a/env/mtd.c
+++ b/env/mtd.c
@@ -32,7 +32,7 @@ static int setup_mtd_device(struct mtd_info **mtd_env)
static int env_mtd_save(void)
{
- char *saved_buf, *write_buf, *tmp;
+ char *saved_buf = NULL, *write_buf, *tmp;
struct erase_info ei = { };
struct mtd_info *mtd_env;
u32 sect_size, sect_num;
@@ -105,7 +105,7 @@ static int env_mtd_save(void)
}
offset = CONFIG_ENV_OFFSET;
- remaining = sect_size;
+ remaining = write_size;
tmp = write_buf;
puts("Writing to MTD...");