]> git.droids-corp.org - dpdk.git/blobdiff - lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
vfio: fix overflow of BAR region offset and size
[dpdk.git] / lib / librte_eal / linuxapp / eal / eal_pci_vfio.c
index 426953ab4f30e291b4053d579f67b20d9d8380e7..6127f5fd68a7d772df3845a765c99c1a4706e5fc 100644 (file)
@@ -728,7 +728,7 @@ pci_vfio_map_resource(struct rte_pci_device *dev)
                struct vfio_region_info reg = { .argsz = sizeof(reg) };
                void *bar_addr;
                struct memreg {
-                       uint32_t offset, size;
+                       unsigned long offset, size;
                } memreg[2] = {};
 
                reg.index = i;
@@ -771,7 +771,7 @@ pci_vfio_map_resource(struct rte_pci_device *dev)
                                RTE_LOG(DEBUG, EAL,
                                        "Trying to map BAR %d that contains the MSI-X "
                                        "table. Trying offsets: "
-                                       "%04x:%04x, %04x:%04x\n", i,
+                                       "0x%04lx:0x%04lx, 0x%04lx:0x%04lx\n", i,
                                        memreg[0].offset, memreg[0].size,
                                        memreg[1].offset, memreg[1].size);
                        }