qemu-traditional/passthrough: fix off-by-one in PCI config space register index check Register 255 (0xff) is still valid to be accessed. Reported-by: Rolu Signed-off-by: Jan Beulich --- a/hw/pass-through.c +++ b/hw/pass-through.c @@ -1538,7 +1538,7 @@ static void pt_pci_write_config(PCIDevic #endif /* check offset range */ - if (address >= 0xFF) + if (address > 0xFF) { PT_LOG_DEV(d, "Error: Failed to write register with offset exceeding FFh. " "[Offset:%02xh][Length:%d]\n", address, len); @@ -1714,7 +1714,7 @@ static uint32_t pt_pci_read_config(PCIDe int ret = 0; /* check offset range */ - if (address >= 0xFF) + if (address > 0xFF) { PT_LOG_DEV(d, "Error: Failed to read register with offset exceeding FFh. " "[Offset:%02xh][Length:%d]\n", address, len);