]> Gentwo Git Trees - linux/.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)
committerMark Brown <broonie@kernel.org>
Thu, 6 Nov 2025 13:12:32 +0000 (13:12 +0000)
commit6b6eddc63ce871897d3a5bc4f8f593e698aef104
tree2c4c2d48720dc42ac86de836b35dfe5847c9f2a0
parent249d96b492efb7a773296ab2c62179918301c146
ASoC: cs4271: Fix regulator leak on probe failure

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>
sound/soc/codecs/cs4271.c