Message ID | 1675147318-75117-1-git-send-email-ye.li@nxp.com |
---|---|
State | Accepted |
Commit | ccd0542ab2607228c8e434e2875b014f9bba49f8 |
Delegated to: | Tom Rini |
Headers | show |
Series | env: mmc: Fix offset issue for env save | expand |
On 1/31/23 15:41, Ye Li wrote: > 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 <ye.li@nxp.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com> Best Regards, Jaehoon Chung > --- > env/mmc.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/env/mmc.c b/env/mmc.c > index 8576141..5b01f65 100644 > --- a/env/mmc.c > +++ b/env/mmc.c > @@ -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);
On Tue, Jan 31, 2023 at 02:41:58PM +0800, Ye Li wrote: > 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 <ye.li@nxp.com> > Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com> Applied to u-boot/master, thanks!
diff --git a/env/mmc.c b/env/mmc.c index 8576141..5b01f65 100644 --- a/env/mmc.c +++ b/env/mmc.c @@ -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);
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 <ye.li@nxp.com> --- env/mmc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)