]> git.apps.os.sepia.ceph.com Git - ceph-client.git/commit
net/mlx5: HWS, Fix memory leak in hws_action_get_shared_stc_nic error flow
authorLama Kayal <lkayal@nvidia.com>
Mon, 25 Aug 2025 14:34:25 +0000 (17:34 +0300)
committerJakub Kicinski <kuba@kernel.org>
Wed, 27 Aug 2025 01:00:25 +0000 (18:00 -0700)
commita630f83592cdad1253523a1b760cfe78fef6cd9c
tree6f03b2d2ff55c65c51ac2d9dd8e8be66dee17a32
parent2c0a959bebdc1ada13cf9a8242f177c5400299e6
net/mlx5: HWS, Fix memory leak in hws_action_get_shared_stc_nic error flow

When an invalid stc_type is provided, the function allocates memory for
shared_stc but jumps to unlock_and_out without freeing it, causing a
memory leak.

Fix by jumping to free_shared_stc label instead to ensure proper cleanup.

Fixes: 504e536d9010 ("net/mlx5: HWS, added actions handling")
Signed-off-by: Lama Kayal <lkayal@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Link: https://patch.msgid.link/20250825143435.598584-3-mbloch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/action.c