Skip to contentSkip to conversation

mempool/octeontx: fix error handling in initialization

PATCH Applied [email protected] 2 participants 2 messages Dec 19, 2019 – Jan 14, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mempool/octeontx: fix error handling in initialization

From: Krzysztof Kanas <[email protected]>

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")
---
 drivers/mempool/octeontx/octeontx_fpavf.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/mempool/octeontx/octeontx_fpavf.c +2 -4
index c97267db3cc3..63f8fb3b500a 100644
@@ -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;
Signature · 1 line
2.21.0
Acked-by on v1 1/1 Applied
#1 lore raw
Quoted 10 lines · On Thu, Dec 19, 2019 at 4:14 PM <[email protected]> wrote:

From: Krzysztof Kanas <[email protected]>

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")
Quoted 1 line

Applied to dpdk-next-net-mrvl/master. Thanks

Quoted 24 lines
---
 drivers/mempool/octeontx/octeontx_fpavf.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/mempool/octeontx/octeontx_fpavf.c +2 -5
index c97267db3cc3..63f8fb3b500a 100644
@@ -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.21.0