Skip to content
Commit dbfeafda authored by Kang Chen's avatar Kang Chen Committed by Guenter Roeck
Browse files

hwmon: (nzxt-smart2) handle failure of devm_add_action in nzxt_smart2_hid_probe

1. replace the devm_add_action with devm_add_action_or_reset to ensure
the mutex lock can be destroyed when it fails.
2. use local wrapper function mutex_fini instead of mutex_destroy to
avoid undefined behaviours.
3. add a check of devm_add_action_or_reset and return early when it fails.

Link: https://lore.kernel.org/all/f5043281-9b3e-e454-16fe-ef4cde36dfdb@roeck-us.net


Signed-off-by: default avatarKang Chen <void0red@gmail.com>
Link: https://lore.kernel.org/r/20230227091534.907101-1-void0red@gmail.com


Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 37ef30fb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment