]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ASoC: cs4271: Fix resource leak in cs4271_soc_resume()
authorHarshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Sat, 10 Jan 2026 19:53:36 +0000 (11:53 -0800)
committerMark Brown <broonie@kernel.org>
Thu, 5 Feb 2026 00:46:04 +0000 (00:46 +0000)
commitfef1f756155c30511397bbcd9d55640ab2e44d99
treec310e4df36a47d5b4b0443255c28ef958b749127
parentdc8384d85c034b3c3912ec7fc43784da5b884c27
ASoC: cs4271: Fix resource leak in cs4271_soc_resume()

Smatch detects this resource leak:

sound/soc/codecs/cs4271.c:548 cs4271_soc_resume() warn:
 'cs4271->clk' from clk_prepare_enable() not released on lines: 540,546.

Instead of direct returns, unprepare the clock and disable regulators on
the error paths.

Fixes: cf6bf51b5325 ("ASoC: cs4271: Add support for the external mclk")
Fixes: 9a397f473657 ("ASoC: cs4271: add regulator consumer support")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Herve Codina <herve.codina@bootlin.com>
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Link: https://patch.msgid.link/20260110195337.2522347-1-harshit.m.mogalapalli@oracle.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/cs4271.c