[v4,2/8] bus/dpaa: fix resource leak in variable dev
Checks
Commit Message
From: Apeksha Gupta <apeksha.gupta@nxp.com>
Resource leak:
variable dev is going out of scope leaks the storage.
Coverity issue: CID 373703
Fixes: d61138d4f0e2 ("drivers: remove direct access to interrupt handle")
Cc: hkalra@marvell.com
Cc: stable@dpdk.org
Signed-off-by: Apeksha Gupta <apeksha.gupta@nxp.com>
Signed-off-by: Vanshika Shukla <vanshika.shukla@nxp.com>
---
drivers/bus/dpaa/dpaa_bus.c | 2 ++
1 file changed, 2 insertions(+)
@@ -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;
}