diff options
author | Leah Rowe <leah@libreboot.org> | 2023-04-07 02:08:06 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2023-04-07 02:08:06 +0100 |
commit | 34eeca1f031f1b7ab559f5e6d840b4f4aca9eabe (patch) | |
tree | d6b1d2810ea452ae5a70da23df3c21ca1062ce57 /util/nvmutil/nvmutil.c | |
parent | 01e2ed3034c482e636637171ddd77f8c51f8e2be (diff) |
util/nvmutil: fix possible regression
i went too hard on the sloc reductions
a check inside a for loop could cause
incomplete reading of gbe images
revert that
Diffstat (limited to 'util/nvmutil/nvmutil.c')
-rw-r--r-- | util/nvmutil/nvmutil.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 64448ddb..9f4e03cf 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -164,7 +164,9 @@ readGbeFile(int *fd, const char *path, int flags, size_t nr) else if (errno == ENOTDIR) errno = 0; - for (int p = 0; (p < 2) && (!skipread[p]); p++) { + for (int p = 0; p < 2; p++) { + if (skipread[p]) + continue; if (pread((*fd), (uint8_t *) gbe[p], nr, p << 12) == -1) err(errno, "%s", path); if (big_endian) |