diff mbox series

[v2,5/8] bus/dpaa: fix resource leak

Message ID 1523269371-28799-5-git-send-email-hemant.agrawal@nxp.com
State Accepted
Commit 35bb5234defc3d1629e1f24db0ade342b0157e70
Headers show
Series [v2,1/8] bus/dpaa: fix the resource leak issue | expand

Commit Message

Hemant Agrawal April 9, 2018, 10:22 a.m. UTC
Fixes: 1459585888b5 ("bus/dpaa: fix memory allocation during scan")
Coverity issue: 268337
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

Acked-By: Shreyansh Jain <shreyansh.jain@nxp.com>

---
 drivers/bus/dpaa/base/fman/fman.c | 2 ++
 1 file changed, 2 insertions(+)

-- 
2.7.4
diff mbox series

Patch

diff --git a/drivers/bus/dpaa/base/fman/fman.c b/drivers/bus/dpaa/base/fman/fman.c
index e6fd5f3..be91da4 100644
--- a/drivers/bus/dpaa/base/fman/fman.c
+++ b/drivers/bus/dpaa/base/fman/fman.c
@@ -442,6 +442,7 @@  fman_if_init(const struct device_node *dpa_node)
 		if (!pool_node) {
 			FMAN_ERR(-ENXIO, "%s: bad fsl,bman-buffer-pools\n",
 				 dname);
+			free(bpool);
 			goto err;
 		}
 		pname = pool_node->full_name;
@@ -449,6 +450,7 @@  fman_if_init(const struct device_node *dpa_node)
 		prop = of_get_property(pool_node, "fsl,bpid", &proplen);
 		if (!prop) {
 			FMAN_ERR(-EINVAL, "%s: no fsl,bpid\n", pname);
+			free(bpool);
 			goto err;
 		}
 		assert(proplen == sizeof(*prop));