fw_env: Add missing write failure check
PATCH 1/1 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 dbc34323796b ("tools: env: Implement atomic replace for filesystem")
Signed-off-by Alex Kiernan <[email protected]>
---
tools/env/fw_env.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/env/fw_env.c +1 -1
@@ -1317,7 +1317,7 @@ static int flash_io_write(int fd_current) rc =-1 ; } -if (target_temp) { +if (rc >=0 && target_temp) {int dir_fd; dir_fd =open (dname,O_DIRECTORY |O_RDONLY );
Signature · 1 line
2.17.1
PATCH 1/1 fw_env: Add missing write failure check
Quoted 6 lines · Alex Kiernan
If
flash_writefails, 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 dbc34323796b ("tools: env: Implement atomic replace for filesystem")Signed-off-by Alex Kiernan <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190620/c23e3e48/attachment.sig>