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: 9bc692f83b ("mempool/octeontx: add application domain validation")
Cc: stable@dpdk.org

Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
This commit is contained in:
Krzysztof Kanas 2019-12-19 11:44:34 +01:00 committed by Ferruh Yigit
parent 04952bac8c
commit 4f2c3c7b1d

View File

@ -305,10 +305,8 @@ octeontx_fpapf_pool_destroy(unsigned int gpool_index)
int ret = -1; int ret = -1;
fpa = octeontx_get_fpavf(gpool_index); fpa = octeontx_get_fpavf(gpool_index);
if (fpa == NULL) { if (fpa == NULL)
ret = -EINVAL; return -EINVAL;
goto err;
}
hdr.coproc = FPA_COPROC; hdr.coproc = FPA_COPROC;
hdr.msg = FPA_CONFIGSET; hdr.msg = FPA_CONFIGSET;