mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-25 06:00:43 +00:00
fw_env: Add missing write failure check
If flash_write fails, whilst we propagate this up to our caller, we need
to avoid swapping in the new file (if we're on a filesystem) in this
case.
Fixes: dbc3432379
("tools: env: Implement atomic replace for filesystem")
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
This commit is contained in:
parent
656d8da9d2
commit
a762311a6c
1 changed files with 1 additions and 1 deletions
2
tools/env/fw_env.c
vendored
2
tools/env/fw_env.c
vendored
|
@ -1317,7 +1317,7 @@ static int flash_io_write(int fd_current)
|
||||||
rc = -1;
|
rc = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target_temp) {
|
if (rc >= 0 && target_temp) {
|
||||||
int dir_fd;
|
int dir_fd;
|
||||||
|
|
||||||
dir_fd = open(dname, O_DIRECTORY | O_RDONLY);
|
dir_fd = open(dname, O_DIRECTORY | O_RDONLY);
|
||||||
|
|
Loading…
Reference in a new issue