Re: [PATCH] ASoC: cs4271: Fix resource leak in cs4271_soc_resume()
From: Alexander Sverdlin
Date: Sat Jan 10 2026 - 15:12:30 EST
Thanks for the patch Harshit!
On Sat, 2026-01-10 at 11:53 -0800, Harshit Mogalapalli wrote:
> 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@xxxxxxxxxx>
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@xxxxxxxxx>
> ---
> Only compile tested.
> ---
> sound/soc/codecs/cs4271.c | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
--
Alexander Sverdlin.