diff mbox series

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

Message ID 1522918464-4586-5-git-send-email-hemant.agrawal@nxp.com
State Superseded
Headers show
Series [1/8] bus/dpaa: fix the resource leak issue | expand

Commit Message

Hemant Agrawal April 5, 2018, 8:54 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>

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

-- 
2.7.4

Comments

Shreyansh Jain April 9, 2018, 7:18 a.m. UTC | #1
On Thursday 05 April 2018 02:24 PM, Hemant Agrawal wrote:
> 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>
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));