Re: [PATCH] ASoC: mxs-sgtl5000: disable MCLK on error paths of mxs_sgtl5000_probe()

From: Mark Brown

Date: Wed Apr 01 2026 - 09:03:51 EST


On Wed, Apr 01, 2026 at 01:30:51PM +0800, Haoxiang Li wrote:
> Call mxs_saif_put_mclk() to disable MCLK on error
> paths of mxs_sgtl5000_probe().

> ret = devm_snd_soc_register_card(&pdev->dev, card);
> - if (ret)
> + if (ret) {
> + mxs_saif_put_mclk(0);
> return dev_err_probe(&pdev->dev, ret, "snd_soc_register_card failed\n");
> + }

This fixes the leak here, however it does highlight that there's a
preexisting issue on remove where we disable the MCLK in remove() but
due to the use of devm_ above we're only unregistering the card after
that has returned.

Attachment: signature.asc
Description: PGP signature