]> git.itanic.dy.fi Git - linux-stable/commit
net/mlx5: Devcom, serialize devcom registration
authorShay Drory <shayd@nvidia.com>
Tue, 2 May 2023 10:36:42 +0000 (13:36 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 May 2023 13:17:28 +0000 (14:17 +0100)
commitb8bce4366f4782383c1c0829a4800fa077338b4f
treedd0b08e953717fa58041dd27636a3da374e3e671
parenta3a516caef2c5be2f4d171890a8b3415bfab4e5e
net/mlx5: Devcom, serialize devcom registration

commit 1f893f57a3bf9fe1f4bcb25b55aea7f7f9712fe7 upstream.

From one hand, mlx5 driver is allowing to probe PFs in parallel.
From the other hand, devcom, which is a share resource between PFs, is
registered without any lock. This might resulted in memory problems.

Hence, use the global mlx5_dev_list_lock in order to serialize devcom
registration.

Fixes: fadd59fc50d0 ("net/mlx5: Introduce inter-device communication mechanism")
Signed-off-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c