diff options
author | Brandon Maier <brandon.maier@rockwellcollins.com> | 2020-12-17 17:19:18 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-04-16 11:55:55 -0400 |
commit | b9c3052fbb25bff26702e6c16abfd0a5ec92040c (patch) | |
tree | 6aa4cba91429f8c13bcb33c899c2739c388bb9ec /include/env.h | |
parent | bcb44f62b21e88cc74bc26939eb1dac95d2f430b (diff) | |
download | u-boot-b9c3052fbb25bff26702e6c16abfd0a5ec92040c.zip u-boot-b9c3052fbb25bff26702e6c16abfd0a5ec92040c.tar.gz u-boot-b9c3052fbb25bff26702e6c16abfd0a5ec92040c.tar.bz2 |
env: increment redund flag on read fail
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>
Diffstat (limited to 'include/env.h')
-rw-r--r-- | include/env.h | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/include/env.h b/include/env.h index c15339a..b5731e4 100644 --- a/include/env.h +++ b/include/env.h @@ -328,8 +328,6 @@ int env_export(struct environment_s *env_out); * @buf2_read_fail: 0 if buf2 is valid, non-zero if invalid * @return 0 if OK, * -EIO if no environment is valid, - * -EINVAL if read of second entry is good - * -ENOENT if read of first entry is good * -ENOMSG if the CRC was bad */ |