From: Hemant Agrawal Date: Mon, 9 Apr 2018 10:22:48 +0000 (+0530) Subject: bus/dpaa: fix resource leak X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=35bb5234defc3d1629e1f24db0ade342b0157e70;p=dpdk.git 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 --- 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));