mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-28 15:41:40 +00:00
tools: env: return error if ubi_update_start() fails
The UBI_IOCVOLUP ioctl can fail if exclusive access to the volume isn't
obtained. If this happens, the flush operation doesn't return error,
leaving the caller without knowledge of missing flush.
Fix this by forwarding the error (-1) from ubi_update_start().
Fixes: 34255b92e6
("tools: env: Add support for direct read/write UBI volumes")
Signed-off-by: Martin Hundebøll <martin@geanix.com>
This commit is contained in:
parent
603e26f763
commit
09779488a9
1 changed files with 1 additions and 1 deletions
2
tools/env/fw_env.c
vendored
2
tools/env/fw_env.c
vendored
|
@ -1208,7 +1208,7 @@ static int flash_write(int fd_current, int fd_target, int dev_target)
|
|||
|
||||
if (IS_UBI(dev_target)) {
|
||||
if (ubi_update_start(fd_target, CUR_ENVSIZE) < 0)
|
||||
return 0;
|
||||
return -1;
|
||||
return ubi_write(fd_target, environment.image, CUR_ENVSIZE);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue