summaryrefslogtreecommitdiff
path: root/util/nvmutil/nvmutil.c
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-13 23:02:26 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-13 23:02:26 +0000
commit692632275cce14b648f638aa4b01de69bf75d308 (patch)
tree22ad445555ec66ff6c029af5afb9f5f14d337f47 /util/nvmutil/nvmutil.c
parent0450c2bef1906d0ae9b29ea6009e19c826866342 (diff)
util/nvmutil: properly reset lseek on error
don't return. set r instead. this will fall through and return the same way, but with proper reset. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil/nvmutil.c')
-rw-r--r--util/nvmutil/nvmutil.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index 68627d3a..901ba9a4 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -1719,10 +1719,9 @@ try_rw_again:
goto err_prw;
if ((off_orig = lseek_eintr(fd, (off_t)0, SEEK_CUR)) == (off_t)-1)
- return -1;
-
- if (lseek_eintr(fd, off, SEEK_SET) == (off_t)-1)
- return -1;
+ r = -1;
+ else if (lseek_eintr(fd, off, SEEK_SET) == (off_t)-1)
+ r = -1;
do {
if (rw_type == IO_PREAD)