UPSTREAM: 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)
committerHuang, Tao <huangtao@rock-chips.com>
Mon, 6 Mar 2017 10:28:40 +0000 (18:28 +0800)
commit59ba6e0376c6cd680f9688648c680b8c642f325c
tree11d637c448ccfe6499bd3b0dd97f25aadaea8267
parent286d645c529781e8cb5b44f97d1d5adfa42f6d4d
UPSTREAM: 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>
(cherry picked from commit 2c0a303a128cbef54a7b58dc2e413b874d760097)

Change-Id: I27a96e1b5ff3034fa068bda5436a479e01e5a61b
Signed-off-by: David Wu <david.wu@rock-chips.com>
drivers/regulator/core.c