]> git.baikalelectronics.ru Git - kernel.git/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:03:33 +0000 (14:03 +0100)
commit3b574c3a55b387f879b4cfe4d4643550d6c050e5
tree9ff7ebc4df8cbb1497a6933cacdea95911b49013
parentb66f051056f9ba1921a5a28c7e494f2c0abc23d6
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: 38d7b8849540 ("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