[PATCH v3 04/11] bus/pci: fix mapping leak in bus cleanup
fengchengwen
fengchengwen at huawei.com
Wed Jun 24 03:24:15 CEST 2026
On 6/23/2026 6:54 PM, David Marchand wrote:
> When calling this bus cleanup, PCI resources were not unmapped.
>
> Fixes: 1cab1a40ea9b ("bus: cleanup devices on shutdown")
> Cc: stable at dpdk.org
>
> Signed-off-by: David Marchand <david.marchand at redhat.com>
> ---
> drivers/bus/pci/pci_common.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c
> index fd18b8772b..791e9a7b49 100644
> --- a/drivers/bus/pci/pci_common.c
> +++ b/drivers/bus/pci/pci_common.c
> @@ -344,6 +344,10 @@ pci_cleanup(void)
> rte_errno = errno;
> error = -1;
> }
> +
> + if (drv->drv_flags & RTE_PCI_DRV_NEED_MAPPING)
> + rte_pci_unmap_device(dev);
rte_pci_unmap_device() also invoked in some drivers remove callback, e.g.
eth_virtio_pci_uninit()
ifcvf_pci_remove()
...
In this case it may doulbe-free
> +
> dev->device.driver = NULL;
>
> free:
More information about the dev
mailing list