]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net/mlx5: LAG, Fix off-by-one in single-FDB error rollback
authorShay Drory <shayd@nvidia.com>
Tue, 30 Jun 2026 11:29:15 +0000 (14:29 +0300)
committerPaolo Abeni <pabeni@redhat.com>
Fri, 3 Jul 2026 16:39:02 +0000 (18:39 +0200)
commit0f0e4ae6975c773f7854fc48932a267f6c79088f
tree0ef7de90055457557b4e522a95941e4b48e29d43
parent539dfcf69105d8d3d4d677b71de6e5ede2e6dfa0
net/mlx5: LAG, Fix off-by-one in single-FDB error rollback

On failure at index i, the reverse cleanup loop in
mlx5_lag_create_single_fdb() starts from i, so the failed index
itself is rolled back. That can operate on uninitialized state or
double-tear-down a rule the add_one path already self-rolled-back.

Start the rollback from i - 1 so only successfully-installed entries
are undone.

Fixes: ddbb5ddc43ad ("net/mlx5: LAG, Refactor lag logic")
Signed-off-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20260630112917.698313-2-tariqt@nvidia.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/mellanox/mlx5/core/lag/shared_fdb.c