From: Tomasz Duszynski <tduszynski@marvell.com>
To: <dev@dpdk.org>, Tomasz Duszynski <tduszynski@marvell.com>
Subject: [PATCH] bus/platform: fix resource leak
Date: Thu, 16 Mar 2023 09:14:55 +0100 [thread overview]
Message-ID: <20230316081455.3352891-1-tduszynski@marvell.com> (raw)
On error function may return without releasing some
allocated resources which causes a memory leak. Fix it.
Coverity issue: 383660
Fixes: 17c839f74da3 ("bus: add platform bus")
Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
---
drivers/bus/platform/platform_params.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/bus/platform/platform_params.c b/drivers/bus/platform/platform_params.c
index edc246b53e..0eb8eb56e7 100644
--- a/drivers/bus/platform/platform_params.c
+++ b/drivers/bus/platform/platform_params.c
@@ -63,8 +63,10 @@ platform_bus_dev_iterate(const void *start, const char *str,
}
find_device = platform_bus.bus.find_device;
- if (find_device == NULL)
+ if (find_device == NULL) {
+ rte_kvargs_free(kvargs);
return NULL;
+ }
dev = platform_bus.bus.find_device(start, platform_dev_match, kvargs);
rte_kvargs_free(kvargs);
--
2.34.1
next reply other threads:[~2023-03-16 8:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-16 8:14 Tomasz Duszynski [this message]
2023-03-16 16:50 ` Thomas Monjalon
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=20230316081455.3352891-1-tduszynski@marvell.com \
--to=tduszynski@marvell.com \
--cc=dev@dpdk.org \
/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).