summaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2016-04-12 10:05:43 +0300
committerMark Brown <broonie@kernel.org>2016-04-13 09:43:00 +0300
commit2c0a303a128cbef54a7b58dc2e413b874d760097 (patch)
tree94214f415ad4d80a6de16846220532d584296cc5 /drivers/regulator
parente437b90026ac754a0f8b4fe44b844d12ce6162d1 (diff)
downloadlinux-2c0a303a128cbef54a7b58dc2e413b874d760097.tar.xz
regulator: core: Fix locking of GPIO list on free
When we acquire a shareable enable GPIO on probe we do so with the regulator_list_mutex held. However when we release the GPIOs we do this immediately after dropping the mutex meaning that the list could become corrupted. Move the release into the locked region to avoid this. Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 1cff11205642..e414c24b2906 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -4021,8 +4021,8 @@ void regulator_unregister(struct regulator_dev *rdev)
WARN_ON(rdev->open_count);
unset_regulator_supplies(rdev);
list_del(&rdev->list);
- mutex_unlock(&regulator_list_mutex);
regulator_ena_gpio_free(rdev);
+ mutex_unlock(&regulator_list_mutex);
device_unregister(&rdev->dev);
}
EXPORT_SYMBOL_GPL(regulator_unregister);