From 4f2c3c7b1da78bbb6270668e7a2b412863439b7f Mon Sep 17 00:00:00 2001 From: Krzysztof Kanas Date: Thu, 19 Dec 2019 11:44:34 +0100 Subject: [PATCH] mempool/octeontx: fix error handling in initialization When octeontx_get_fpavf fails fpa pointer is used to get pool_stack_base, which is then freed. Coverity issue: 351263 Fixes: 9bc692f83baa ("mempool/octeontx: add application domain validation") Cc: stable@dpdk.org Signed-off-by: Krzysztof Kanas Acked-by: Jerin Jacob --- drivers/mempool/octeontx/octeontx_fpavf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mempool/octeontx/octeontx_fpavf.c b/drivers/mempool/octeontx/octeontx_fpavf.c index c97267db3c..63f8fb3b50 100644 --- a/drivers/mempool/octeontx/octeontx_fpavf.c +++ b/drivers/mempool/octeontx/octeontx_fpavf.c @@ -305,10 +305,8 @@ octeontx_fpapf_pool_destroy(unsigned int gpool_index) int ret = -1; fpa = octeontx_get_fpavf(gpool_index); - if (fpa == NULL) { - ret = -EINVAL; - goto err; - } + if (fpa == NULL) + return -EINVAL; hdr.coproc = FPA_COPROC; hdr.msg = FPA_CONFIGSET; -- 2.20.1