]> 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)
commit80373161e81d0392acad43da66e460e6d0b40666
treef4b010a2a66f50a7656d2ceb73ae7a14622447fc
parentc19765e43490f3145f15aa224cded860a387f691
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: f9c27418fbca ("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