]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ASoC: cs4271: Fix regulator leak on probe failure
authorHaotian Zhang <vulab@iscas.ac.cn>
Wed, 5 Nov 2025 06:22:46 +0000 (14:22 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 6 Dec 2025 21:12:34 +0000 (06:12 +0900)
commit6df6ead6382d07dec752a91a30d953b7efa4e50b
treec0d29cfbddde236a007cef5c130bd156b6788288
parentc8ba621ffdf69b645db5768d88b3d03e6406a5cf
ASoC: cs4271: Fix regulator leak on probe failure

[ Upstream commit 6b6eddc63ce871897d3a5bc4f8f593e698aef104 ]

The probe function enables regulators at the beginning
but fails to disable them in its error handling path.
If any operation after enabling the regulators fails,
the probe will exit with an error, leaving the regulators
permanently enabled, which could lead to a resource leak.

Add a proper error handling path to call regulator_bulk_disable()
before returning an error.

Fixes: 9a397f473657 ("ASoC: cs4271: add regulator consumer support")
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20251105062246.1955-1-vulab@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/codecs/cs4271.c