net/mlx5e: Fix error handling in mlx5e_refresh_tirs
authorSaeed Mahameed <saeedm@nvidia.com>
Sun, 28 May 2023 06:07:08 +0000 (23:07 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Jun 2023 08:34:04 +0000 (10:34 +0200)
commit4156c6ff331afe198ee7298d77f58f6b175df1d7
tree98a73192793eb55f22ca6650c986b93084ca2c4c
parent7c3e271626d17e4a6dcdea084127023a3307f91f
net/mlx5e: Fix error handling in mlx5e_refresh_tirs

[ Upstream commit b6193d7030e3c59f1d4c75648c9c8fa40cad2bcd ]

Allocation failure is outside the critical lock section and should
return immediately rather than jumping to the unlock section.

Also unlock as soon as required and remove the now redundant jump label.

Fixes: 80a2a9026b24 ("net/mlx5e: Add a lock on tir list")
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en_common.c