]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: Bridge, take rtnl lock in init error handler
authorVlad Buslov <vladbu@nvidia.com>
Thu, 6 Jan 2022 14:40:18 +0000 (16:40 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Wed, 2 Feb 2022 04:59:38 +0000 (20:59 -0800)
commit4deea5400f24a668d103204e2bab78398a5537fd
tree06268da0b4ae5b41c1f4071a47e06eae3a6fe7c3
parente5fd144681ba7a18574031af6f8e94d67b575e91
net/mlx5: Bridge, take rtnl lock in init error handler

The mlx5_esw_bridge_cleanup() is expected to be called with rtnl lock
taken, which is true for mlx5e_rep_bridge_cleanup() function but not for
error handling code in mlx5e_rep_bridge_init(). Add missing rtnl
lock/unlock calls and extend both mlx5_esw_bridge_cleanup() and its dual
function mlx5_esw_bridge_init() with ASSERT_RTNL() to verify the invariant
from now on.

Fixes: 30f7eca68766 ("net/mlx5: Bridge, handle FDB events")
Fixes: 7fbb3026bbb7 ("net/mlx5: Bridge, add offload infrastructure")
Signed-off-by: Vlad Buslov <vladbu@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c
drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c