]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: SF: Fix error flow of SFs allocation flow
authorShay Drory <shayd@nvidia.com>
Thu, 11 Feb 2021 13:41:35 +0000 (15:41 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Wed, 10 Mar 2021 19:01:58 +0000 (11:01 -0800)
commit7eb73878b52355b6bb6006bb52df32d9ca44f8c0
tree66fcde9dabbd0d1277fc1e8d1bf6288559e663c1
parent7adfe139d86447142ce4caa1f4a2bffd86e36a7b
net/mlx5: SF: Fix error flow of SFs allocation flow

When SF id is unavailable, code jumps to wrong label that accesses
sw id array outside of its range.
Hence, when SF id is not allocated, avoid accessing such array.

Fixes: dfb17a831774 ("net/mlx5: SF, Add port add delete functionality")
Signed-off-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Parav Pandit <parav@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/sf/hw_table.c