xen/pt: Fixup addr validation in xen_pt_pci_config_access_check
authorAnoob Soman <anoob.soman@citrix.com>
Wed, 5 Jul 2017 13:56:35 +0000 (14:56 +0100)
committerStefano Stabellini <sstabellini@kernel.org>
Fri, 7 Jul 2017 18:13:10 +0000 (11:13 -0700)
xen_pt_pci_config_access_check checks if addr >= 0xFF. 0xFF is a valid
address and should not be ignored.

Signed-off-by: Anoob Soman <anoob.soman@citrix.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
hw/xen/xen_pt.c

index b6d71bb52aa44bd4f342c893fcebe8808c15fb09..375efa68f699c59bcbe678ec067064aab9c5566a 100644 (file)
@@ -85,7 +85,7 @@ void xen_pt_log(const PCIDevice *d, const char *f, ...)
 static int xen_pt_pci_config_access_check(PCIDevice *d, uint32_t addr, int len)
 {
     /* check offset range */
-    if (addr >= 0xFF) {
+    if (addr > 0xFF) {
         XEN_PT_ERR(d, "Failed to access register with offset exceeding 0xFF. "
                    "(addr: 0x%02x, len: %d)\n", addr, len);
         return -1;