Skip to content
Commit 45734723 authored by Jonathan Cameron's avatar Jonathan Cameron
Browse files

iio: adc: ad7124: Fix missbalanced regulator enable / disable on error.



If the devm_regulator_get() call succeeded but not the regulator_enable()
then regulator_disable() would be called on a regulator that was not
enabled.

Fix this by moving regulator enabling / disabling over to
devm_ management via devm_add_action_or_reset.

Alexandru's sign-off here because he pulled Jonathan's patch into
a larger set which Jonathan then applied.

Fixes: b3af341b ("iio: adc: Add ad7124 support")
Reviewed-by: default avatarAlexandru Ardelean <ardeleanalex@gmail.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: default avatarAlexandru Ardelean <aardelean@deviqon.com>
Cc: <Stable@vger.kernel.org>
parent ba9c25d9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment