diff mbox series

[2/8] bus/dpaa: fix the unchecked return value

Message ID 1522918464-4586-2-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
From: Sunil Kumar Kori <sunil.kori@nxp.com>


Fixes: 5d944582d028 ("bus/dpaa: check portal presence in the caller function")
Coverity issue: 268323
Cc: stable@dpdk.org

Signed-off-by: Sunil Kumar Kori <sunil.kori@nxp.com>

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

---
 drivers/bus/dpaa/dpaa_bus.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

-- 
2.7.4
diff mbox series

Patch

diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c
index 3535da5..ffc90a7 100644
--- a/drivers/bus/dpaa/dpaa_bus.c
+++ b/drivers/bus/dpaa/dpaa_bus.c
@@ -308,9 +308,15 @@  rte_dpaa_portal_fq_init(void *arg, struct qman_fq *fq)
 	/* Affine above created portal with channel*/
 	u32 sdqcr;
 	struct qman_portal *qp;
+	int ret;
 
-	if (unlikely(!RTE_PER_LCORE(dpaa_io)))
-		rte_dpaa_portal_init(arg);
+	if (unlikely(!RTE_PER_LCORE(dpaa_io))) {
+		ret = rte_dpaa_portal_init(arg);
+		if (ret < 0) {
+			DPAA_BUS_LOG(ERR, "portal initialization failure");
+			return ret;
+		}
+	}
 
 	/* Initialise qman specific portals */
 	qp = fsl_qman_portal_create();