From: Ben Walker Date: Wed, 11 Jan 2017 17:10:10 +0000 (-0700) Subject: pci: unmap resources if probe fails X-Git-Tag: spdx-start~5192 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e84ad157b7bc44161de069df4bb34deeda2daf0c;p=dpdk.git pci: unmap resources if probe fails If resources were mapped prior to probe, unmap them if probe fails. This does not handle the case where the kernel driver was forcibly unbound prior to probe. Signed-off-by: Ben Walker Acked-by: Shreyansh Jain --- diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c index 33485bce8a..72547bd285 100644 --- a/lib/librte_eal/common/eal_common_pci.c +++ b/lib/librte_eal/common/eal_common_pci.c @@ -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; }