diff options
author | Roy Novich <royno@nvidia.com> | 2023-01-04 10:16:21 +0100 |
---|---|---|
committer | Saeed Mahameed <saeedm@nvidia.com> | 2023-01-10 07:08:34 +0100 |
commit | ab4b01bfdaa69492fb36484026b0a0f0af02d75a (patch) | |
tree | bb2c2504ea30d7d3546499b6b05ddbaf21d3d10e /drivers | |
parent | net/mlx5: Fix command stats access after free (diff) | |
download | linux-ab4b01bfdaa69492fb36484026b0a0f0af02d75a.tar.xz linux-ab4b01bfdaa69492fb36484026b0a0f0af02d75a.zip |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index cff5f2e29e1e..abcc614b6191 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -4084,6 +4084,9 @@ static netdev_features_t mlx5e_fix_features(struct net_device *netdev, struct mlx5e_vlan_table *vlan; struct mlx5e_params *params; + if (!netif_device_present(netdev)) + return features; + vlan = mlx5e_fs_get_vlan(priv->fs); mutex_lock(&priv->state_lock); params = &priv->channels.params; |