DPDK patches and discussions
 help / color / mirror / Atom feed
From: <kkanas@marvell.com>
To: <dev@dpdk.org>, Harman Kalra <hkalra@marvell.com>
Cc: Krzysztof Kanas <kkanas@marvell.com>, <pbhagavatula@marvell.com>
Subject: [dpdk-dev] [PATCH] mempool/octeontx: fix error handling in initialization
Date: Thu, 19 Dec 2019 11:44:34 +0100	[thread overview]
Message-ID: <20191219104434.32578-1-kkanas@marvell.com> (raw)

From: Krzysztof Kanas <kkanas@marvell.com>

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: pbhagavatula@marvell.com

Signed-off-by: Krzysztof Kanas <kkanas@marvell.com>
---
 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 c97267db3cc3..63f8fb3b500a 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.21.0


             reply	other threads:[~2019-12-19 10:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-19 10:44 kkanas [this message]
2020-01-14  7:02 ` Jerin Jacob

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191219104434.32578-1-kkanas@marvell.com \
    --to=kkanas@marvell.com \
    --cc=dev@dpdk.org \
    --cc=hkalra@marvell.com \
    --cc=pbhagavatula@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).