patch 'bus/fslmc: fix device name leak' has been queued to stable release 24.11.9
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Thu Nov 5 17:41:29 CET 2026
Hi,
FYI, your patch has been queued to stable release 24.11.9
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/07/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/c1aab227dd1af611055009d73f64f794d152cc8f
Thanks.
Luca Boccassi
---
>From c1aab227dd1af611055009d73f64f794d152cc8f Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand at redhat.com>
Date: Wed, 9 Sep 2026 16:52:11 +0200
Subject: [PATCH] bus/fslmc: fix device name leak
[ upstream commit 39f6ebc48e782027035f2f555dc9c6e215f8e306 ]
The device name allocated during scan was never freed.
Store it to the (unused) name field in the rte_dpaa2_device.
This simplifies the device freeing to a simple free() call later.
Fixes: 828d51d8fc3e ("bus/fslmc: refactor scan and probe functions")
Signed-off-by: David Marchand <david.marchand at redhat.com>
Acked-by: Hemant Agrawal <hemant.agrawal at nxp.com>
---
drivers/bus/fslmc/bus_fslmc_driver.h | 4 +---
drivers/bus/fslmc/fslmc_bus.c | 9 +++++----
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/bus/fslmc/bus_fslmc_driver.h b/drivers/bus/fslmc/bus_fslmc_driver.h
index 34b564001da..202ce494a09 100644
--- a/drivers/bus/fslmc/bus_fslmc_driver.h
+++ b/drivers/bus/fslmc/bus_fslmc_driver.h
@@ -37,8 +37,6 @@
extern "C" {
#endif
-#define FSLMC_OBJECT_MAX_LEN 32 /**< Length of each device on bus */
-
#define DPAA2_INVALID_MBUF_SEQN 0
typedef uint32_t dpaa2_seqn_t;
@@ -108,7 +106,7 @@ struct rte_dpaa2_device {
char ep_name[RTE_DEV_NAME_MAX_LEN];
struct rte_intr_handle *intr_handle; /**< Interrupt handle */
struct rte_dpaa2_driver *driver; /**< Associated driver */
- char name[FSLMC_OBJECT_MAX_LEN]; /**< DPAA2 Object name*/
+ char name[RTE_DEV_NAME_MAX_LEN];
};
typedef int (*rte_dpaa2_obj_create_t)(int vdev_fd,
diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index 3a89445262c..3cbbae7dc4b 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -16,6 +16,7 @@
#include <rte_memcpy.h>
#include <ethdev_driver.h>
#include <rte_mbuf_dyn.h>
+#include <rte_string_fns.h>
#include "private.h"
#include <fslmc_vfio.h>
@@ -207,12 +208,12 @@ scan_one_fslmc_device(char *dev_name)
}
sscanf(t_ptr, "%hu", &dev->object_id);
- dev->device.name = strdup(dev_name);
- if (!dev->device.name) {
- DPAA2_BUS_ERR("Unable to clone device name. Out of memory");
- ret = -ENOMEM;
+ if (rte_strscpy(dev->name, dev_name, sizeof(dev->name)) < 0) {
+ DPAA2_BUS_ERR("Unable to copy device name: %s", rte_strerror(rte_errno));
+ ret = -rte_errno;
goto cleanup;
}
+ dev->device.name = dev->name;
dev->device.devargs = fslmc_devargs_lookup(dev);
/* Update the device found into the device_count table */
--
2.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-11-05 16:42:45.147400669 +0000
+++ 0002-bus-fslmc-fix-device-name-leak.patch 2026-11-05 16:42:44.881059591 +0000
@@ -1 +1 @@
-From 39f6ebc48e782027035f2f555dc9c6e215f8e306 Mon Sep 17 00:00:00 2001
+From c1aab227dd1af611055009d73f64f794d152cc8f Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 39f6ebc48e782027035f2f555dc9c6e215f8e306 ]
+
@@ -12 +13,0 @@
-Cc: stable at dpdk.org
@@ -18,2 +19,2 @@
- drivers/bus/fslmc/fslmc_bus.c | 8 ++++----
- 2 files changed, 5 insertions(+), 7 deletions(-)
+ drivers/bus/fslmc/fslmc_bus.c | 9 +++++----
+ 2 files changed, 6 insertions(+), 7 deletions(-)
@@ -22 +23 @@
-index 44f81cf662..ead9d6613c 100644
+index 34b564001da..202ce494a09 100644
@@ -25,3 +26,3 @@
-@@ -39,8 +39,6 @@ extern "C" {
-
- struct vfio_device_info;
+@@ -37,8 +37,6 @@
+ extern "C" {
+ #endif
@@ -34,2 +35 @@
-@@ -101,7 +99,7 @@ struct rte_dpaa2_device {
- uint16_t ep_object_id; /**< Endpoint DPAA2 Object ID */
+@@ -108,7 +106,7 @@ struct rte_dpaa2_device {
@@ -37,0 +38 @@
+ struct rte_dpaa2_driver *driver; /**< Associated driver */
@@ -44 +45 @@
-index 98bd898acb..632142d128 100644
+index 3a89445262c..3cbbae7dc4b 100644
@@ -47 +48,9 @@
-@@ -179,12 +179,12 @@ scan_one_fslmc_device(char *dev_name)
+@@ -16,6 +16,7 @@
+ #include <rte_memcpy.h>
+ #include <ethdev_driver.h>
+ #include <rte_mbuf_dyn.h>
++#include <rte_string_fns.h>
+
+ #include "private.h"
+ #include <fslmc_vfio.h>
+@@ -207,12 +208,12 @@ scan_one_fslmc_device(char *dev_name)
@@ -61 +70 @@
- dev->device.devargs = rte_bus_find_devargs(&rte_fslmc_bus, dev_name);
+ dev->device.devargs = fslmc_devargs_lookup(dev);
More information about the stable
mailing list