mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 15:14:43 +00:00
b9c3052fbb
If one of the reads fails when importing redundant environments (a single read failure), the env_flags wouldn't get initialized in env_import_redund(). If a user then calls saveenv, the new environment will have the wrong flags value. So on the next load the new environment will be ignored. While debugging this, I also noticed that env/sf.c was not correctly handling a single read failure, as it would not check the crc before assigning it to gd->env_addr. Having a special error path for when there is a single read failure seems unnecessary and may lead to future bugs. Instead collapse the 'single read failure' error to be the same as a 'single crc failure'. That way env_check_redund() either passes or fails, and if it passes we are guaranteed to have checked the CRC. Signed-off-by: Brandon Maier <brandon.maier@rockwellcollins.com> CC: Joe Hershberger <joe.hershberger@ni.com> CC: Wolfgang Denk <wd@denx.de> CC: Heiko Schocher <hs@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com> |
||
---|---|---|
.. | ||
attr.c | ||
callback.c | ||
common.c | ||
eeprom.c | ||
embedded.c | ||
env.c | ||
ext4.c | ||
fat.c | ||
flags.c | ||
flash.c | ||
Kconfig | ||
Makefile | ||
mmc.c | ||
nand.c | ||
nowhere.c | ||
nvram.c | ||
onenand.c | ||
remote.c | ||
sata.c | ||
sf.c | ||
ubi.c |