net/mlx5e: Verify dev is present for fix features ndo
authorRoy Novich <royno@nvidia.com>
Wed, 4 Jan 2023 09:16:21 +0000 (11:16 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Tue, 10 Jan 2023 06:08:34 +0000 (22:08 -0800)
commitab4b01bfdaa69492fb36484026b0a0f0af02d75a
treebb2c2504ea30d7d3546499b6b05ddbaf21d3d10e
parentda2e552b469a0cd130ff70a88ccc4139da428a65
net/mlx5e: Verify dev is present for fix features ndo

The native NIC port net device instance is being used as Uplink
representor.  While changing profiles private resources are not
available, fix features ndo does not check if the netdev is present.
Add driver protection to verify private resources are ready.

Fixes: 7a9fb35e8c3a ("net/mlx5e: Do not reload ethernet ports when changing eswitch mode")
Signed-off-by: Roy Novich <royno@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c