regulator: core: Fix locking of GPIO list on free
authorMark Brown <broonie@kernel.org>
Tue, 12 Apr 2016 07:05:43 +0000 (08:05 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 13 Apr 2016 06:43:00 +0000 (07:43 +0100)
commit2c0a303a128cbef54a7b58dc2e413b874d760097
tree94214f415ad4d80a6de16846220532d584296cc5
parente437b90026ac754a0f8b4fe44b844d12ce6162d1
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>
drivers/regulator/core.c