[PATCH v17 01/23] net/dpaa: fix device remove
David Marchand
david.marchand at redhat.com
Tue Sep 29 14:41:28 CEST 2026
On Tue, 29 Sept 2026 at 12:45, Hemant Agrawal <hemant.agrawal at nxp.com> wrote:
>
> From: Gagandeep Singh <g.singh at nxp.com>
>
> Adds a check to not to close device if already closed.
>
> Fixes: 78ea4b4fcb52 ("bus/dpaa: improve cleanup")
> Cc: stable at dpdk.org
>
> Signed-off-by: Gagandeep Singh <g.singh at nxp.com>
> ---
> drivers/net/dpaa/dpaa_ethdev.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
> index 1aaf97f175..7dcd67fb81 100644
> --- a/drivers/net/dpaa/dpaa_ethdev.c
> +++ b/drivers/net/dpaa/dpaa_ethdev.c
> @@ -2679,9 +2679,12 @@ rte_dpaa_remove(struct rte_dpaa_device *dpaa_dev)
> PMD_INIT_FUNC_TRACE();
>
> eth_dev = rte_eth_dev_allocated(dpaa_dev->device.name);
> - ret = dpaa_eth_dev_close(eth_dev);
> - if (eth_dev->state != RTE_ETH_DEV_UNUSED) {
> - dpaa_eth_dev_close(eth_dev);
> + if (eth_dev && eth_dev->state != RTE_ETH_DEV_UNUSED) {
Checking the state looks wrong.
If this driver .remove op is called, it means a probing succeeded.
And if probing succeeded and a ethdev exists, it should be in attached state.
Now, in the hypothesis we end up here with an allocated "unused"
eth_dev, it smells like a leak from a probing failure.
I spotted one, but it does not seem related to the current patch.
https://github.com/DPDK/dpdk/blob/main/drivers/net/dpaa/dpaa_ethdev.c#L2614
--
David Marchand
More information about the stable
mailing list