diff options
author | Vadim Pasternak <vadimp@nvidia.com> | 2022-08-23 23:19:35 +0300 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2022-09-01 15:22:48 +0300 |
commit | 1e092b7faa6b507125b69c92a51bb22c2d549d37 (patch) | |
tree | 7be25d4651aa62d430a74af598ccad6764d3b647 /crypto/dh_helper.c | |
parent | 17c2bd6bea4c32fe691c1f9ebcc20fd48d77454a (diff) | |
download | linux-1e092b7faa6b507125b69c92a51bb22c2d549d37.tar.xz |
platform/mellanox: mlxreg-lc: Fix locking issue
Fix locking issues:
- mlxreg_lc_state_update() takes a lock when set or clear
"MLXREG_LC_POWERED".
- All the devices can be deleted before MLXREG_LC_POWERED flag is cleared.
To fix it:
- Add lock() / unlock() at the beginning / end of
mlxreg_lc_event_handler() and remove locking from
mlxreg_lc_power_on_off() and mlxreg_lc_enable_disable()
- Add locked version of mlxreg_lc_state_update() -
mlxreg_lc_state_update_locked() for using outside
mlxreg_lc_event_handler().
(2) Remove redundant NULL check for of if 'data->notifier'.
Fixes: 62f9529b8d5c87b ("platform/mellanox: mlxreg-lc: Add initial support for Nvidia line card devices")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Link: https://lore.kernel.org/r/20220823201937.46855-3-vadimp@nvidia.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'crypto/dh_helper.c')
0 files changed, 0 insertions, 0 deletions