[PATCH] ASoC: fsl: imx-sgtl5000: drop codec device reference after probe

Valerio Setti vsetti at baylibre.com
Wed Nov 4 02:08:52 PST 2026


> imx_sgtl5000_probe() takes a reference on the codec i2c device, but the
> successful probe path returns without releasing it. Only the error
> paths drop the reference, so every successful probe leaks the i2c
> client device.
> 
> Release the reference once the card has been registered.
> 
> Fixes: 81e8e4926167 ("ASoC: fsl: add sgtl5000 clock support for imx-sgtl5000")
> Cc: stable at vger.kernel.org
> Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
> Signed-off-by: Wentao Liang <vulab at iscas.ac.cn>
>
> diff --git a/sound/soc/fsl/imx-sgtl5000.c b/sound/soc/fsl/imx-sgtl5000.c
> index 8bcf54ef709e..8ce333eb47fe 100644
> --- a/sound/soc/fsl/imx-sgtl5000.c
> +++ b/sound/soc/fsl/imx-sgtl5000.c
> @@ -177,6 +177,8 @@ static int imx_sgtl5000_probe(struct platform_device *pdev)
>  		goto put_device;
>  	}
>  
> +	put_device(&codec_dev->dev);
> +
>  	of_node_put(ssi_np);
>  	of_node_put(codec_np);
>  

Reviewed-by: Valerio Setti <vsetti at baylibre.com>

-- 
Valerio Setti <vsetti at baylibre.com>



More information about the linux-arm-kernel mailing list