Skip to contentSkip to conversation

qemu-traditional/passthrough: fix off-by-one in PCI config space register index check

PATCH In review Jan Beulich 2 participants 2 messages Jun 25, 2012 – Jun 29, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu-traditional/passthrough: fix off-by-one in PCI config space register index check

Register 255 (0xff) is still valid to be accessed.

hw/pass-through.c +2 -2
@@ -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);

qemu-traditional/passthrough: fix off-by-one in PCI config space register index check

Register 255 (0xff) is still valid to be accessed.

hw/pass-through.c +2 -2
@@ -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);

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel