[PATCH 07/45] drivers: fix double free of dpaa2 device on uninit

David Marchand david.marchand at redhat.com
Thu Sep 3 16:05:22 CEST 2026


On Thu, 3 Sept 2026 at 15:55, Prashant Gupta <prashant.gupta_3 at nxp.com> wrote:
>
> From: Gagandeep Singh <g.singh at nxp.com>
>
> dpaa2_dpdmai_dev_uninit() was called from dpaa2_qdma_close(), but
> rte_dma close may run without a matching device remove, so the
> uninitialization (which frees the qdma_dev allocation and the MC portal)
> could run twice or leak the MC portal.
>
> Move dpaa2_dpdmai_dev_uninit() to dpaa2_qdma_remove(), which is the
> correct teardown counterpart of dpaa2_qdma_probe(). To reach the dmadev
> from the remove callback, store the rte_dma_dev pointer in
> struct rte_dpaa2_device at probe time and use it in remove, dropping the
> now-unused forward declaration.
>
> Fixes: 8caf8427f85a ("dma/dpaa2: introduce driver skeleton")
> Cc: stable at dpdk.org
>
> Signed-off-by: Gagandeep Singh <g.singh at nxp.com>

Nack.

I just cleaned this up so maybe it is probably a regression of my change.
868a3abd0ee5 ("dma/dpaa2: remove dmadev pointer from bus device")

Thank you.


-- 
David Marchand



More information about the dev mailing list