util/nvmutil: r_type check in rw_gbe_file_part

i already send the right arg anyway. this is a
preventative bug fix against future maintenance.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-13 13:12:51 +00:00
parent 847f63be87
commit fbe2986a6e

View File

@@ -1456,7 +1456,11 @@ rw_gbe_file_part(size_t p, int rw_type,
uint8_t *mem_offset;
if (rw_type == IO_WRITE || rw_type == IO_PWRITE)
if (rw_type < IO_PREAD || rw_type > IO_PWRITE)
err(errno, "%s: %s: part %lu: invalid rw_type, %d",
fname, rw_type_str, (unsigned long)p, rw_type);
if (rw_type == IO_PWRITE)
invert = 0;
/*