patch 'net/dpaa: fix double close and null deref on remove' has been queued to stable release 25.11.5

Kevin Traynor ktraynor at redhat.com
Thu Dec 3 14:03:47 CET 2026


Hi,

FYI, your patch has been queued to stable release 25.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/08/26. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/50c59007209bb29d22b2c706efb893e986f300c7

Thanks.

Kevin

---
>From 50c59007209bb29d22b2c706efb893e986f300c7 Mon Sep 17 00:00:00 2001
From: Hemant Agrawal <hemant.agrawal at nxp.com>
Date: Fri, 16 Oct 2026 16:49:34 +0530
Subject: [PATCH] net/dpaa: fix double close and null deref on remove

[ upstream commit ee71ea9bd68b8c1de3b869ec5da18a2342d68242 ]

rte_dpaa_remove() closed the port twice:

	ret = dpaa_eth_dev_close(eth_dev);
	if (eth_dev->state !=  RTE_ETH_DEV_UNUSED) {
		dpaa_eth_dev_close(eth_dev);

The first call ran unconditionally, the second ran again on a port
that had just been torn down. The unconditional call also dereferenced
eth_dev without checking that rte_eth_dev_allocated() found anything.
rte_eth_dev_close() releases the port, so an application that closed
its ports before rte_eal_cleanup() crashed in remove.

Close the port once, only when it is still in use, and log the close
result before releasing the port. The release status is returned,
since the port must be released regardless of how close ended.

Fixes: 78ea4b4fcb52 ("bus/dpaa: improve cleanup")

Signed-off-by: Hemant Agrawal <hemant.agrawal at nxp.com>
---
 drivers/net/dpaa/dpaa_ethdev.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index 2eb81c45b1..61cfb88d70 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -2685,10 +2685,13 @@ rte_dpaa_remove(struct rte_dpaa_device *dpaa_dev)
 	PMD_INIT_FUNC_TRACE();
 
-	eth_dev = dpaa_dev->eth_dev;
-	ret = dpaa_eth_dev_close(eth_dev);
-	if (eth_dev->state !=  RTE_ETH_DEV_UNUSED) {
-		dpaa_eth_dev_close(eth_dev);
+	eth_dev = rte_eth_dev_allocated(dpaa_dev->device.name);
+	if (eth_dev != NULL && eth_dev->state != RTE_ETH_DEV_UNUSED) {
+		ret = dpaa_eth_dev_close(eth_dev);
+		if (ret != 0)
+			DPAA_PMD_WARN("%s: close failed(%d), releasing port",
+				dpaa_dev->device.name, ret);
 		ret = rte_eth_dev_release_port(eth_dev);
 	}
+
 	dpaa_valid_dev--;
 	if (!dpaa_valid_dev)
-- 
2.56.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-12-03 12:52:47.740992103 +0000
+++ 0301-net-dpaa-fix-double-close-and-null-deref-on-remove.patch	2026-12-03 12:52:39.239703191 +0000
@@ -1 +1 @@
-From ee71ea9bd68b8c1de3b869ec5da18a2342d68242 Mon Sep 17 00:00:00 2001
+From 50c59007209bb29d22b2c706efb893e986f300c7 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit ee71ea9bd68b8c1de3b869ec5da18a2342d68242 ]
+
@@ -23 +24,0 @@
-Cc: stable at dpdk.org
@@ -27,2 +28,2 @@
- drivers/net/dpaa/dpaa_ethdev.c | 9 ++++++---
- 1 file changed, 6 insertions(+), 3 deletions(-)
+ drivers/net/dpaa/dpaa_ethdev.c | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
@@ -31 +32 @@
-index 1aaf97f175..a5b02cc9a8 100644
+index 2eb81c45b1..61cfb88d70 100644
@@ -34 +35,2 @@
-@@ -2680,9 +2680,12 @@ rte_dpaa_remove(struct rte_dpaa_device *dpaa_dev)
+@@ -2685,10 +2685,13 @@ rte_dpaa_remove(struct rte_dpaa_device *dpaa_dev)
+ 	PMD_INIT_FUNC_TRACE();
@@ -36 +38 @@
- 	eth_dev = rte_eth_dev_allocated(dpaa_dev->device.name);
+-	eth_dev = dpaa_dev->eth_dev;
@@ -39,0 +42 @@
++	eth_dev = rte_eth_dev_allocated(dpaa_dev->device.name);



More information about the stable mailing list