iio: adc: ad7124: Fix missbalanced regulator enable / disable on error.
stable inclusion from stable-5.10.42 commit fbb02b5e7a34fcc0b40698f0b4535b93251c48aa bugzilla: 55093 CVE: NA -------------------------------- commit 45734723 upstream. 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: NAlexandru Ardelean <ardeleanalex@gmail.com> Signed-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: NAlexandru Ardelean <aardelean@deviqon.com> Cc: <Stable@vger.kernel.org> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NChen Jun <chenjun102@huawei.com> Acked-by: NWeilong Chen <chenweilong@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Showing
想要评论请 注册 或 登录