Skip to content

Commit

Permalink
env: mmc: Fix offset issue for env save
Browse files Browse the repository at this point in the history
Fix the issue in commit 46c9016 ("env: mcc: Drop unnecessary #ifdefs")
If CONFIG_SYS_REDUNDAND_ENVIRONMENT is not defined, the offset value
becomes undetermined, so write env to unexpected offset.

Signed-off-by: Ye Li <[email protected]>
Reviewed-by: Jaehoon Chung <[email protected]>
  • Loading branch information
Ye Li authored and trini committed Feb 6, 2023
1 parent 94a51af commit ccd0542
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions env/mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,11 @@ static int env_mmc_save(void)
if (ret)
goto fini;
}
}

if (mmc_get_env_addr(mmc, copy, &offset)) {
ret = 1;
goto fini;
}
if (mmc_get_env_addr(mmc, copy, &offset)) {
ret = 1;
goto fini;
}

printf("Writing to %sMMC(%d)... ", copy ? "redundant " : "", dev);
Expand Down

0 comments on commit ccd0542

Please sign in to comment.