From a4f0fa29488e582ab8b5ef9db475b3d26ded690c Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Tue, 27 Nov 2018 10:44:39 +0000 Subject: New upstream version 18.11 Change-Id: I6c63198045de1e34fda8a7b4665d89d5f4a20d20 Signed-off-by: Luca Boccassi --- drivers/bus/pci/linux/pci_uio.c | 2 +- drivers/bus/pci/linux/pci_vfio.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'drivers/bus') diff --git a/drivers/bus/pci/linux/pci_uio.c b/drivers/bus/pci/linux/pci_uio.c index a7c14421..09ecbb7a 100644 --- a/drivers/bus/pci/linux/pci_uio.c +++ b/drivers/bus/pci/linux/pci_uio.c @@ -296,7 +296,7 @@ pci_uio_map_resource_by_index(struct rte_pci_device *dev, int res_idx, maps = uio_res->maps; /* 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)); diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c index ffd26f19..54a4c959 100644 --- a/drivers/bus/pci/linux/pci_vfio.c +++ b/drivers/bus/pci/linux/pci_vfio.c @@ -794,11 +794,6 @@ pci_vfio_map_resource_secondary(struct rte_pci_device *dev) snprintf(pci_addr, sizeof(pci_addr), PCI_PRI_FMT, loc->domain, loc->bus, loc->devid, loc->function); - ret = rte_vfio_setup_device(rte_pci_get_sysfs_path(), pci_addr, - &vfio_dev_fd, &device_info); - if (ret) - return ret; - /* if we're in a secondary process, just find our tailq entry */ TAILQ_FOREACH(vfio_res, vfio_res_list, next) { if (rte_pci_addr_cmp(&vfio_res->pci_addr, @@ -810,9 +805,14 @@ pci_vfio_map_resource_secondary(struct rte_pci_device *dev) if (vfio_res == NULL) { RTE_LOG(ERR, EAL, " %s cannot find TAILQ entry for PCI device!\n", pci_addr); - goto err_vfio_dev_fd; + return -1; } + ret = rte_vfio_setup_device(rte_pci_get_sysfs_path(), pci_addr, + &vfio_dev_fd, &device_info); + if (ret) + return ret; + /* map BARs */ maps = vfio_res->maps; -- cgit 1.2.3-korg