patch 'bus/dpaa: fix FD leak for CCSR mmap' has been queued to stable release 24.11.7
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Mon Jul 20 19:03:49 CEST 2026
Hi,
FYI, your patch has been queued to stable release 24.11.7
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/22/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/bluca/dpdk-stable
This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/571a6010c7eacfa56b16d243cc89da3fb47000d1
Thanks.
Luca Boccassi
---
>From 571a6010c7eacfa56b16d243cc89da3fb47000d1 Mon Sep 17 00:00:00 2001
From: Hemant Agrawal <hemant.agrawal at nxp.com>
Date: Mon, 13 Jul 2026 15:47:36 +0530
Subject: [PATCH] bus/dpaa: fix FD leak for CCSR mmap
[ upstream commit ac8a972811cf0d533c3fe71e98216f37c3273cc3 ]
The CCSR file descriptor was kept open after mmap() was done.
Close the fd immediately after mmap() as it is no longer needed,
preventing a file descriptor leak.
Fixes: 8e253882cd31 ("bus/dpaa: support interrupt portal based fd")
Signed-off-by: Hemant Agrawal <hemant.agrawal at nxp.com>
Signed-off-by: Jun Yang <jun.yang at nxp.com>
---
drivers/bus/dpaa/base/qbman/bman_driver.c | 3 ++-
drivers/bus/dpaa/base/qbman/qman_driver.c | 6 +++---
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/bus/dpaa/base/qbman/bman_driver.c b/drivers/bus/dpaa/base/qbman/bman_driver.c
index ee35e03da1..b67a953e7c 100644
--- a/drivers/bus/dpaa/base/qbman/bman_driver.c
+++ b/drivers/bus/dpaa/base/qbman/bman_driver.c
@@ -145,7 +145,7 @@ void bman_thread_irq(void)
int bman_init_ccsr(const struct device_node *node)
{
- static int ccsr_map_fd;
+ int ccsr_map_fd;
uint64_t phys_addr;
const uint32_t *bman_addr;
uint64_t regs_size;
@@ -169,6 +169,7 @@ int bman_init_ccsr(const struct device_node *node)
bman_ccsr_map = mmap(NULL, regs_size, PROT_READ |
PROT_WRITE, MAP_SHARED, ccsr_map_fd, phys_addr);
+ close(ccsr_map_fd);
if (bman_ccsr_map == MAP_FAILED) {
pr_err("Can not map BMan CCSR base Bman: "
"0x%x Phys: 0x%" PRIx64 " size 0x%" PRIu64,
diff --git a/drivers/bus/dpaa/base/qbman/qman_driver.c b/drivers/bus/dpaa/base/qbman/qman_driver.c
index cdce6b777b..e01eb0bd46 100644
--- a/drivers/bus/dpaa/base/qbman/qman_driver.c
+++ b/drivers/bus/dpaa/base/qbman/qman_driver.c
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
*
* Copyright 2008-2016 Freescale Semiconductor Inc.
- * Copyright 2017-2022 NXP
+ * Copyright 2017-2022, 2025-2026 NXP
*
*/
@@ -247,7 +247,7 @@ int qman_global_init(void)
const struct device_node *dt_node;
size_t lenp;
const u32 *chanid;
- static int ccsr_map_fd;
+ int ccsr_map_fd;
const uint32_t *qman_addr;
uint64_t phys_addr;
uint64_t regs_size;
@@ -335,9 +335,9 @@ int qman_global_init(void)
pr_err("Can not open /dev/mem for qman ccsr map\n");
return ccsr_map_fd;
}
-
qman_ccsr_map = mmap(NULL, regs_size, PROT_READ | PROT_WRITE,
MAP_SHARED, ccsr_map_fd, phys_addr);
+ close(ccsr_map_fd);
if (qman_ccsr_map == MAP_FAILED) {
pr_err("Can not map qman ccsr base\n");
return -EINVAL;
--
2.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-07-20 18:03:25.709795152 +0100
+++ 0005-bus-dpaa-fix-FD-leak-for-CCSR-mmap.patch 2026-07-20 18:03:25.496443092 +0100
@@ -1 +1 @@
-From ac8a972811cf0d533c3fe71e98216f37c3273cc3 Mon Sep 17 00:00:00 2001
+From 571a6010c7eacfa56b16d243cc89da3fb47000d1 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit ac8a972811cf0d533c3fe71e98216f37c3273cc3 ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org
@@ -21 +22 @@
-index 23e44ac10b..71a2028383 100644
+index ee35e03da1..b67a953e7c 100644
@@ -42 +43 @@
-index 3bab8b8337..45b094e0c6 100644
+index cdce6b777b..e01eb0bd46 100644
@@ -46 +47 @@
- /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
+ /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
@@ -49 +50 @@
-- * Copyright 2017-2022, 2025 NXP
+- * Copyright 2017-2022 NXP
@@ -54 +55 @@
-@@ -270,7 +270,7 @@ int qman_global_init(void)
+@@ -247,7 +247,7 @@ int qman_global_init(void)
@@ -63 +64 @@
-@@ -358,9 +358,9 @@ int qman_global_init(void)
+@@ -335,9 +335,9 @@ int qman_global_init(void)
More information about the stable
mailing list