summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-14 22:01:06 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-26 06:59:41 +0000
commit291c8a9a8b93040936d6fa5d26a7fa68e894444b (patch)
tree31c485dd724b894fd1ebc850e78536701f01578c
parentfe9900e7a14aa85aaa6721959b695b2408416435 (diff)
util/nvmutil: tidy up rw_file_exact
Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r--util/nvmutil/nvmutil.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index 28a2332c..7ece1764 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -1876,9 +1876,13 @@ rw_file_exact(int fd, u8 *mem, size_t nrw,
if ((size_t)rc >= nrw)
break;
- if ((rv = prw(fd,
- mem + (size_t)rc, nrw - rc, off + rc, rw_type,
- loop_eagain, loop_eintr)) < 0)
+ rv = prw(fd,
+ mem + (size_t)rc,
+ nrw - (size_t)rc,
+ off + (off_t)rc,
+ rw_type, loop_eagain, loop_eintr);
+
+ if (rv < 0)
return -1;
/* Prevent theoretical overflow */