summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-15 01:45:23 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-26 06:59:41 +0000
commitd890a6b1387e392076a64799298ae18a812a42ae (patch)
tree9054c1d516efffecd48619d7ee2d045d9f4bd684 /util
parent7f192b4344037c2707eb3f68971dcb2c6b6544fa (diff)
util/nvmutil pread: rw_over_nrw exit, not set
otherwise, if it's -1 and errno happens to be EINTR or EAGAIN, we might loop on what is a real error. this bug fixes that edge case. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util')
-rw-r--r--util/nvmutil/nvmutil.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index f1ea171b..60aacf07 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -2126,7 +2126,8 @@ real_pread_pwrite:
else if (rw_type == IO_PWRITE)
r = write(fd, mem, nrw);
- r = rw_over_nrw(r, nrw);
+ if (rw_over_nrw(r, nrw) == -1)
+ return -1;
} while (r == -1 &&
(errno == try_err(loop_eintr, EINTR)