DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] bus/platform: fix resource leak
@ 2023-03-16  8:14 Tomasz Duszynski
  2023-03-16 16:50 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Tomasz Duszynski @ 2023-03-16  8:14 UTC (permalink / raw)
  To: dev, Tomasz Duszynski

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-16 16:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-16  8:14 [PATCH] bus/platform: fix resource leak Tomasz Duszynski
2023-03-16 16:50 ` Thomas Monjalon

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).