Skip to contentSkip to conversation

net/mlx5/hws: fix memory leak on general pool db init

PATCH In review Alex Vesker 3 participants 3 messages Jan 11, 2023 – Feb 12, 2023 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5/hws: fix memory leak on general pool db init

On elemend db init we allocated the element_manager which was unused and not freed.

Fixes b4dd7bcb0dcbe ("net/mlx5/hws: add pool and buddy")
---
 drivers/net/mlx5/hws/mlx5dr_pool.c | 7 -------
 1 file changed, 7 deletions(-)
drivers/net/mlx5/hws/mlx5dr_pool.c +0 -7
index fdbd3d438d..af6a5c743b 100644
@@ -464,13 +464,6 @@ static void mlx5dr_pool_general_element_db_uninit(struct mlx5dr_pool *pool)
  */
 static int mlx5dr_pool_general_element_db_init(struct mlx5dr_pool *pool)
 {
-	pool->db.element_manager = simple_calloc(1, sizeof(*pool->db.element_manager));
-	if (!pool->db.element_manager) {
-		DR_LOG(ERR, "No mem for general elemnt_manager");
-		rte_errno = ENOMEM;
-		return rte_errno;
-	}
-
 	pool->p_db_uninit = &mlx5dr_pool_general_element_db_uninit;
 	pool->p_get_chunk = &mlx5dr_pool_general_element_db_get_chunk;
 	pool->p_put_chunk = &mlx5dr_pool_general_element_db_put_chunk;
Signature · 1 line
2.18.1
#2 lore raw
In reply to Alex Vesker

Hi,

Quoted 10 lines

-----Original Message-----
From: Alex Vesker <[email protected]>
Sent: Wednesday, January 11, 2023 9:49 PM
To: Alex Vesker <[email protected]>; Slava Ovsiienko <[email protected]>; NBU-Contact-Thomas Monjalon (EXTERNAL) <[email protected]>; Suanming Mou <[email protected]>; Matan Azrad <[email protected]>
Cc: [email protected]; Ori Kam <[email protected]>
Subject: [PATCH] net/mlx5/hws: fix memory leak on general pool db init

Quoted 7 lines

On elemend db init we allocated the element_manager which was unused and not freed.

Fixes b4dd7bcb0dcbe ("net/mlx5/hws: add pool and buddy")

---

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh