Skip to content

Commit 2c0a959

Browse files
lkayal-01kuba-moo
authored andcommitted
net/mlx5: HWS, Fix memory leak in hws_pool_buddy_init error path
In the error path of hws_pool_buddy_init(), the buddy allocator cleanup doesn't free the allocator structure itself, causing a memory leak. Add the missing kfree() to properly release all allocated memory. Fixes: c61afff ("net/mlx5: HWS, added memory management handling") Signed-off-by: Lama Kayal <[email protected]> Reviewed-by: Tariq Toukan <[email protected]> Signed-off-by: Mark Bloch <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent aa125f0 commit 2c0a959

File tree

1 file changed

+1
-0
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/steering/hws

1 file changed

+1
-0
lines changed

drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pool.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ static int hws_pool_buddy_init(struct mlx5hws_pool *pool)
124124
mlx5hws_err(pool->ctx, "Failed to create resource type: %d size %zu\n",
125125
pool->type, pool->alloc_log_sz);
126126
mlx5hws_buddy_cleanup(buddy);
127+
kfree(buddy);
127128
return -ENOMEM;
128129
}
129130

0 commit comments

Comments
 (0)