From e26511c8b8534abbbe68ddc7a3b0423d3305cc26 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 10 Mar 2026 06:51:47 +0000 Subject: util/nvmutil: err if unsupported rw_type on i/o Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'util/nvmutil/nvmutil.c') diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 16e02c59..15ff3192 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -270,7 +270,7 @@ static const char *rname = NULL; * The code will handle this properly. */ static uint8_t buf[GBE_FILE_SIZE]; -static uint8_t pad[GBE_PART_SIZE]; +static uint8_t pad[GBE_PART_SIZE]; /* the file that wouldn't die */ static uint16_t mac_buf[3]; static off_t gbe_file_size; @@ -1366,6 +1366,9 @@ rw_file_exact(int fd, uint8_t *mem, size_t len, rval = pread(fd, mem + rc, len - rc, off + rc); else if (rw_type == LESEN) rval = read(fd, mem + rc, len - rc); + else + err(EIO, "%s: %s: Unsupported rw_type", + path, rw_type_str); if (rval > -1) { if (!rval) /* prevent infinite loop */ -- cgit v1.2.1