[PATCH 5/9] bus/dpaa: fix resource leak in variable dev

Gagandeep Singh g.singh at nxp.com
Wed Jul 3 11:41:38 CEST 2024


From: Apeksha Gupta <apeksha.gupta at nxp.com>

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

Fixes: d61138d4f0e2 ("drivers: remove direct access to interrupt handle")
Cc: hkalra at marvell.com
Cc: stable at dpdk.org

Signed-off-by: Apeksha Gupta <apeksha.gupta at nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal 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 6d7d9ef918..3155acb6cb 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -188,6 +188,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;
 		}
 
@@ -239,6 +240,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.25.1



More information about the stable mailing list