DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tomasz Duszynski <tduszynski@marvell.com>
To: <dev@dpdk.org>, Jakub Palider <jpalider@marvell.com>,
	Tomasz Duszynski <tduszynski@marvell.com>
Cc: <jerinj@marvell.com>
Subject: [PATCH] raw/cnxk_gpio: fix resource leak
Date: Tue, 7 Nov 2023 10:59:46 +0100	[thread overview]
Message-ID: <20231107095946.3227242-1-tduszynski@marvell.com> (raw)

Fix resource leak.

Coverity issue: 405118
Fixes: ef2a3f3b4c9e ("raw/cnxk_gpio: support multi-process")

Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
---
 drivers/raw/cnxk_gpio/cnxk_gpio.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/raw/cnxk_gpio/cnxk_gpio.c b/drivers/raw/cnxk_gpio/cnxk_gpio.c
index ebc914afcf..45e2ab5e00 100644
--- a/drivers/raw/cnxk_gpio/cnxk_gpio.c
+++ b/drivers/raw/cnxk_gpio/cnxk_gpio.c
@@ -171,8 +171,10 @@ cnxk_gpio_parse_store_args(struct cnxk_gpio_params **params, const char *args)
 		len += strlen(allowlist) + 1;
 
 	*params = cnxk_gpio_params_reserve(len);
-	if (!(*params))
-		return -ENOMEM;
+	if (!(*params)) {
+		ret = -ENOMEM;
+		goto out;
+	}
 
 	strlcpy((*params)->allowlist, allowlist, strlen(allowlist) + 1);
 
-- 
2.34.1


             reply	other threads:[~2023-11-07 10:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-07  9:59 Tomasz Duszynski [this message]
2023-11-07 13:52 ` 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=20231107095946.3227242-1-tduszynski@marvell.com \
    --to=tduszynski@marvell.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=jpalider@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).