patch 'bus/dpaa: fix memory leak in bus scan' has been queued to stable release 23.11.2

Xueming Li xuemingl at nvidia.com
Mon Aug 12 14:48:40 CEST 2024


Hi,

FYI, your patch has been queued to stable release 23.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/14/24. 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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=0b4bc3a5d1d1c981a2fb2a7de19f05e434036566

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 0b4bc3a5d1d1c981a2fb2a7de19f05e434036566 Mon Sep 17 00:00:00 2001
From: Apeksha Gupta <apeksha.gupta at nxp.com>
Date: Wed, 10 Jul 2024 14:25:28 +0530
Subject: [PATCH] bus/dpaa: fix memory leak in bus scan
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit de0833ffe31739fd40789b1580025bc849d8871f ]

Resource leak:
variable dev is going out of scope leaks the storage.

Coverity issue: 373703
Fixes: d61138d4f0e2 ("drivers: remove direct access to interrupt handle")

Signed-off-by: Apeksha Gupta <apeksha.gupta at nxp.com>
Signed-off-by: Vanshika Shukla <vanshika.shukla at nxp.com>
---
 drivers/bus/dpaa/dpaa_bus.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 0823553398..aaf2a5f43e 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -187,6 +187,7 @@ dpaa_create_device_list(void)
 		if (dev->intr_handle == NULL) {
 			DPAA_BUS_LOG(ERR, "Failed to allocate intr handle");
 			ret = -ENOMEM;
+			free(dev);
 			goto cleanup;
 		}
 
@@ -238,6 +239,7 @@ dpaa_create_device_list(void)
 		if (dev->intr_handle == NULL) {
 			DPAA_BUS_LOG(ERR, "Failed to allocate intr handle");
 			ret = -ENOMEM;
+			free(dev);
 			goto cleanup;
 		}
 
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-08-12 20:44:03.880520291 +0800
+++ 0043-bus-dpaa-fix-memory-leak-in-bus-scan.patch	2024-08-12 20:44:02.025069281 +0800
@@ -1 +1 @@
-From de0833ffe31739fd40789b1580025bc849d8871f Mon Sep 17 00:00:00 2001
+From 0b4bc3a5d1d1c981a2fb2a7de19f05e434036566 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit de0833ffe31739fd40789b1580025bc849d8871f ]
@@ -11 +13,0 @@
-Cc: stable at dpdk.org
@@ -20 +22 @@
-index b8f41ec069..1f6997c77e 100644
+index 0823553398..aaf2a5f43e 100644
@@ -23 +25 @@
-@@ -188,6 +188,7 @@ dpaa_create_device_list(void)
+@@ -187,6 +187,7 @@ dpaa_create_device_list(void)
@@ -31 +33 @@
-@@ -239,6 +240,7 @@ dpaa_create_device_list(void)
+@@ -238,6 +239,7 @@ dpaa_create_device_list(void)


More information about the stable mailing list