mempool/octeontx: fix error handling in initialization
authorKrzysztof Kanas <kkanas@marvell.com>
Thu, 19 Dec 2019 10:44:34 +0000 (11:44 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 17 Jan 2020 18:46:26 +0000 (19:46 +0100)
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 <kkanas@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
drivers/mempool/octeontx/octeontx_fpavf.c

index c97267d..63f8fb3 100644 (file)
@@ -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;