Skip to content

Commit aefb62a

Browse files
sureshdvrkuba-moo
authored andcommitted
net/mlx5: Fix crash during sync firmware reset
When setting Bluefield to DPU NIC mode using mlxconfig tool + sync firmware reset flow, we run into scenario where the host was not eswitch manager at the time of mlx5 driver load but becomes eswitch manager after the sync firmware reset flow. This results in null pointer access of mpfs structure during mac filter add. This change prevents null pointer access but mpfs table entries will not be added. Fixes: 5ec6974 ("net/mlx5: Add support for devlink reload action fw activate") Signed-off-by: Suresh Devarakonda <[email protected]> Reviewed-by: Moshe Shemesh <[email protected]> Reviewed-by: Bodong Wang <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 416ef71 commit aefb62a

File tree

1 file changed

+3
-3
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/lib

1 file changed

+3
-3
lines changed

drivers/net/ethernet/mellanox/mlx5/core/lib/mpfs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ void mlx5_mpfs_cleanup(struct mlx5_core_dev *dev)
122122
{
123123
struct mlx5_mpfs *mpfs = dev->priv.mpfs;
124124

125-
if (!MLX5_ESWITCH_MANAGER(dev))
125+
if (!mpfs)
126126
return;
127127

128128
WARN_ON(!hlist_empty(mpfs->hash));
@@ -137,7 +137,7 @@ int mlx5_mpfs_add_mac(struct mlx5_core_dev *dev, u8 *mac)
137137
int err = 0;
138138
u32 index;
139139

140-
if (!MLX5_ESWITCH_MANAGER(dev))
140+
if (!mpfs)
141141
return 0;
142142

143143
mutex_lock(&mpfs->lock);
@@ -185,7 +185,7 @@ int mlx5_mpfs_del_mac(struct mlx5_core_dev *dev, u8 *mac)
185185
int err = 0;
186186
u32 index;
187187

188-
if (!MLX5_ESWITCH_MANAGER(dev))
188+
if (!mpfs)
189189
return 0;
190190

191191
mutex_lock(&mpfs->lock);

0 commit comments

Comments
 (0)