]> git.droids-corp.org - dpdk.git/blobdiff - lib/librte_eal/common/eal_common_pci.c
pci: unmap resources if probe fails
[dpdk.git] / lib / librte_eal / common / eal_common_pci.c
index 33485bce8ae472ea5bbabb06d17975fda1d22752..72547bd28569c080af69b909f0797ffc51b4dd34 100644 (file)
@@ -210,8 +210,11 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, struct rte_pci_device *d
 
                /* call the driver probe() function */
                ret = dr->probe(dr, dev);
-               if (ret)
+               if (ret) {
                        dev->driver = NULL;
+                       if (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING)
+                               rte_eal_pci_unmap_device(dev);
+               }
 
                return ret;
        }