]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: Avoid double clear or set of sync reset requested
authorMoshe Shemesh <moshe@nvidia.com>
Mon, 11 Apr 2022 17:38:44 +0000 (20:38 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Wed, 4 May 2022 07:00:06 +0000 (00:00 -0700)
commit02a91635a3aa088664f4504d97c758f134b7fb39
treef4b010a2a66f50a7656d2ceb73ae7a14622447fc
parent9b3bf4ee54fd4760afb052795478c264507d1a43
net/mlx5: Avoid double clear or set of sync reset requested

Double clear of reset requested state can lead to NULL pointer as it
will try to delete the timer twice. This can happen for example on a
race between abort from FW and pci error or reset. Avoid such case using
test_and_clear_bit() to verify only one time reset requested state clear
flow. Similarly use test_and_set_bit() to verify only one time reset
requested state set flow.

Fixes: 4b1a4387eec7 ("net/mlx5: Handle sync reset abort event")
Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
Reviewed-by: Maher Sanalla <msanalla@nvidia.com>
Reviewed-by: Shay Drory <shayd@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c