patch 'net/tap: fix resource leaks on creation failure' has been queued to stable release 25.11.1

Kevin Traynor ktraynor at redhat.com
Thu Mar 19 11:02:44 CET 2026


Hi,

FYI, your patch has been queued to stable release 25.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/23/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/0801a0f3efd8ca95a25970a9894b27289472ef1d

Thanks.

Kevin

---
>From 0801a0f3efd8ca95a25970a9894b27289472ef1d Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Sun, 22 Feb 2026 09:30:43 -0800
Subject: [PATCH] net/tap: fix resource leaks on creation failure

[ upstream commit 8c7751daa8a879f46b67969e1b995a99ed010869 ]

Correct two leaks in eth_dev_tap_create():

- process_private was never freed on error_exit. Add free() before
  releasing the port.
- If the process_private malloc failed, the function returned -1
  directly without releasing the ethdev port allocated by
  rte_eth_vdev_allocate(). Jump to a new error_exit_nodev_release
  label instead.

Bugzilla ID: 1881
Fixes: ed8132e7c912 ("net/tap: move fds of queues to be in process private")

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
 drivers/net/tap/rte_eth_tap.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 08d51c3a45..2c12b56b8e 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -2018,5 +2018,5 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,
 	if (process_private == NULL) {
 		TAP_LOG(ERR, "Failed to alloc memory for process private");
-		return -1;
+		goto error_exit_nodev_release;
 	}
 	memset(process_private, 0, sizeof(struct pmd_process_private));
@@ -2208,7 +2208,10 @@ error_exit:
 	if (pmd->ka_fd != -1)
 		close(pmd->ka_fd);
-	/* mac_addrs must not be freed alone because part of dev_private */
-	dev->data->mac_addrs = NULL;
 	rte_intr_instance_free(pmd->intr_handle);
+	free(dev->process_private);
+
+error_exit_nodev_release:
+	/* mac_addrs must not be freed alone because part of dev_private */
+	dev->data->mac_addrs = NULL;
 	rte_eth_dev_release_port(dev);
 
-- 
2.53.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-03-19 10:01:08.468406331 +0000
+++ 0046-net-tap-fix-resource-leaks-on-creation-failure.patch	2026-03-19 10:01:07.114331260 +0000
@@ -1 +1 @@
-From 8c7751daa8a879f46b67969e1b995a99ed010869 Mon Sep 17 00:00:00 2001
+From 0801a0f3efd8ca95a25970a9894b27289472ef1d Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 8c7751daa8a879f46b67969e1b995a99ed010869 ]
+
@@ -17 +18,0 @@
-Cc: stable at dpdk.org
@@ -25 +26 @@
-index 967cd7bf21..cf886b132c 100644
+index 08d51c3a45..2c12b56b8e 100644
@@ -28 +29 @@
-@@ -2000,5 +2000,5 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,
+@@ -2018,5 +2018,5 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,
@@ -35 +36 @@
-@@ -2168,7 +2168,10 @@ error_exit:
+@@ -2208,7 +2208,10 @@ error_exit:



More information about the stable mailing list