net/mlx5e: Avoid detaching non-existing netdev under switchdev mode
authorAlaa Hleihel <alaa@mellanox.com>
Sun, 26 May 2019 08:56:27 +0000 (11:56 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 7 Jun 2019 21:40:37 +0000 (14:40 -0700)
commit47c9d2c99ddeecca61c97618857b70fc7901658b
tree167a4ccf7b09ed052aa55ef935627db8fc3063ec
parentb83c0730167c7ea6c03bffceefb86ae710ab30e2
net/mlx5e: Avoid detaching non-existing netdev under switchdev mode

After introducing dedicated uplink representor, the netdev instance
set over the esw manager vport (PF) became no longer in use, so it was
removed in the cited commit once we're on switchdev mode.
However, the mlx5e_detach function was not updated accordingly, and it
still tries to detach a non-existing netdev, causing a kernel crash.

This patch fixes this issue.

Fixes: aec002f6f82c ("net/mlx5e: Uninstantiate esw manager vport netdev on switchdev mode")
Signed-off-by: Alaa Hleihel <alaa@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c