patch 'net/enetfec: fix file descriptor leak on read error' has been queued to stable release 22.11.11

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Oct 27 17:19:37 CET 2025


Hi,

FYI, your patch has been queued to stable release 22.11.11

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/dcae8c220ba99d898ad10c3b014392fd2e93416e

Thanks.

Luca Boccassi

---
>From dcae8c220ba99d898ad10c3b014392fd2e93416e Mon Sep 17 00:00:00 2001
From: Hemant Agrawal <hemant.agrawal at nxp.com>
Date: Mon, 6 Oct 2025 13:34:00 +0530
Subject: [PATCH] net/enetfec: fix file descriptor leak on read error

[ upstream commit 2e503215692e8ab50e473e963ec58d5ab714a375 ]

The file descriptor was not closed when a read error occurred while
reading the first line from a UIO device file. This could lead to
resource leakage. The patch ensures the descriptor is closed in
case of read failure.

Fixes: b84fdd39638b ("net/enetfec: support UIO")

Signed-off-by: Hemant Agrawal <hemant.agrawal at nxp.com>
Acked-by: Sachin Saxena <sachin.saxena at nxp.com>
---
 drivers/net/enetfec/enet_uio.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/enetfec/enet_uio.c b/drivers/net/enetfec/enet_uio.c
index 6539cbb354..f41e314745 100644
--- a/drivers/net/enetfec/enet_uio.c
+++ b/drivers/net/enetfec/enet_uio.c
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright 2021 NXP
+ * Copyright 2021,2024 NXP
  */
 
 #include <stdbool.h>
@@ -66,13 +66,16 @@ file_read_first_line(const char root[], const char subdir[],
 		"%s/%s/%s", root, subdir, filename);
 
 	fd = open(absolute_file_name, O_RDONLY);
-	if (fd <= 0)
+	if (fd < 0) {
 		ENETFEC_PMD_ERR("Error opening file %s", absolute_file_name);
+		return fd;
+	}
 
 	/* read UIO device name from first line in file */
 	ret = read(fd, line, FEC_UIO_MAX_DEVICE_FILE_NAME_LENGTH);
 	if (ret <= 0) {
 		ENETFEC_PMD_ERR("Error reading file %s", absolute_file_name);
+		close(fd);
 		return ret;
 	}
 	close(fd);
-- 
2.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-10-27 15:54:36.967292619 +0000
+++ 0059-net-enetfec-fix-file-descriptor-leak-on-read-error.patch	2025-10-27 15:54:34.839950653 +0000
@@ -1 +1 @@
-From 2e503215692e8ab50e473e963ec58d5ab714a375 Mon Sep 17 00:00:00 2001
+From dcae8c220ba99d898ad10c3b014392fd2e93416e Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 2e503215692e8ab50e473e963ec58d5ab714a375 ]
+
@@ -12 +13,0 @@
-Cc: stable at dpdk.org
@@ -21 +22 @@
-index 9f4e896985..23cb4e7e93 100644
+index 6539cbb354..f41e314745 100644


More information about the stable mailing list