From 35bb5234defc3d1629e1f24db0ade342b0157e70 Mon Sep 17 00:00:00 2001 From: Hemant Agrawal Date: Mon, 9 Apr 2018 15:52:48 +0530 Subject: [PATCH] bus/dpaa: fix resource leak Coverity issue: 268337 Fixes: 1459585888b5 ("bus/dpaa: fix memory allocation during scan") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal Acked-by: Shreyansh Jain --- drivers/bus/dpaa/base/fman/fman.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/bus/dpaa/base/fman/fman.c b/drivers/bus/dpaa/base/fman/fman.c index e6fd5f3ca0..be91da480a 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)); -- 2.20.1