Merge tag 'upstream/16.11.9' into 16.11.x
[deb_dpdk.git] / lib / librte_eal / linuxapp / eal / eal_pci_uio.c
index 4228067..3ca217f 100644 (file)
@@ -327,7 +327,7 @@ pci_uio_map_resource_by_index(struct rte_pci_device *dev, int res_idx,
                        loc->function, res_idx);
 
        /* allocate memory to keep path */
-       maps[map_idx].path = rte_malloc(NULL, strlen(devname) + 1, 0);
+       maps[map_idx].path = rte_malloc(NULL, sizeof(devname), 0);
        if (maps[map_idx].path == NULL) {
                RTE_LOG(ERR, EAL, "Cannot allocate memory for path: %s\n",
                                strerror(errno));