DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: fix memleak for resource object
@ 2024-06-23 10:35 Mahmoud Maatuq
  2024-06-24 13:59 ` Dariusz Sosnowski
  2024-06-24 19:41 ` [PATCH v2] " Mahmoud Maatuq
  0 siblings, 2 replies; 6+ messages in thread
From: Mahmoud Maatuq @ 2024-06-23 10:35 UTC (permalink / raw)
  To: Dariusz Sosnowski, Viacheslav Ovsiienko, Bing Zhao, Ori Kam,
	Suanming Mou, Matan Azrad
  Cc: dev, Mahmoud Maatuq

Coverity issue: 426424
Fixes: e78e5408da89 ("net/mlx5: remove cache term from the list utility")
Cc: matan@nvidia.com

Signed-off-by: Mahmoud Maatuq <mahmoudmatook.mm@gmail.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index d46beffd4c..1010b8e423 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -12010,9 +12010,12 @@ flow_matcher_create_cb(void *tool_ctx, void *cb_ctx)
 		items = *((const struct rte_flow_item **)(ctx->data2));
 		resource->matcher_object = mlx5dr_bwc_matcher_create
 				(resource->group->tbl, resource->priority, items);
-		if (!(resource->matcher_object))
+		if (!(resource->matcher_object)) {
+			mlx5_free(resource);
 			return NULL;
+		}
 #else
+		mlx5_free(resource);
 		return NULL;
 #endif
 	}
-- 
2.43.0


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

end of thread, other threads:[~2024-07-01 18:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-23 10:35 [PATCH] net/mlx5: fix memleak for resource object Mahmoud Maatuq
2024-06-24 13:59 ` Dariusz Sosnowski
2024-06-24 19:10   ` Mahmoud Maatouq
2024-07-01 18:04     ` Dariusz Sosnowski
2024-06-24 19:41 ` [PATCH v2] " Mahmoud Maatuq
2024-07-01 18:07   ` Dariusz Sosnowski

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