net/mlx5e: Check netdev pointer before checking its net ns
Previously, when comparing the net namespaces, the case where the netdev doesn't exist wasn't taken into account, and therefore can cause a crash. In such a case, the comparing function should return false, as there is no netdev->net to compare the devlink->net to. Furthermore, this will result in an attempt to enter switchdev mode without a netdev to fail, and which is the desired result as there is no meaning in switchdev mode without a net device. Fixes: 662404b2 ("net/mlx5e: Block entering switchdev mode with ns inconsistency") Signed-off-by:Gavin Li <gavinl@nvidia.com> Reviewed-by:
Gavi Teitz <gavi@nvidia.com> Signed-off-by:
Saeed Mahameed <saeedm@nvidia.com>
Loading
Please register or sign in to comment