mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 14:19:09 -04:00
regulator: core: avoid deadlock in QTI addition to regulator_unregister()
regulator_unregister() calls rdev_free_qti_debugfs() with the regulator_list_mutex held. rdev_free_qti_debugfs() then calls regulator_put() which attempts to lock regulator_list_mutex again. This leads to deadlock. Modify regulator_unregister() and rdev_free_qti_debugfs() so that mutex deadlock cannot occur. Change-Id: I12bb4c704f7d9332e790c707aba854e224474bdb Signed-off-by: David Collins <collinsd@codeaurora.org>
This commit is contained in:
parent
17439c2c67
commit
29c128cfd2
1 changed files with 2 additions and 3 deletions
|
|
@ -5045,9 +5045,8 @@ DEFINE_DEBUGFS_ATTRIBUTE(reg_set_load_fops, reg_debug_mode_get,
|
|||
static void rdev_free_qti_debugfs(struct regulator_dev *rdev)
|
||||
{
|
||||
if (!IS_ERR_OR_NULL(rdev)) {
|
||||
if (rdev->debug_consumer)
|
||||
rdev->debug_consumer->debugfs = NULL;
|
||||
regulator_put(rdev->debug_consumer);
|
||||
rdev->debug_consumer = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -5658,11 +5657,11 @@ void regulator_unregister(struct regulator_dev *rdev)
|
|||
}
|
||||
|
||||
flush_work(&rdev->disable_work.work);
|
||||
rdev_free_qti_debugfs(rdev);
|
||||
|
||||
mutex_lock(®ulator_list_mutex);
|
||||
|
||||
debugfs_remove_recursive(rdev->debugfs);
|
||||
rdev_free_qti_debugfs(rdev);
|
||||
WARN_ON(rdev->open_count);
|
||||
regulator_remove_coupling(rdev);
|
||||
unset_regulator_supplies(rdev);
|
||||
|
|
|
|||
Loading…
Reference in a new issue