ASoC: fsl: mpc5200-i2s: Free DMA resources on probe failure

mpc5200_audio_dma_create() creates the DMA resources before registering
the component. If snd_soc_register_component() fails, the function
returns directly and leaves the DMA resources allocated.

Call mpc5200_audio_dma_destroy() before returning from this error path.

Fixes: f515b67381 ("ASoC: fsl: mpc5200 combine psc_dma platform data")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
Link: https://patch.msgid.link/20260622094822.926166-1-haoxiang_li2024@163.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Haoxiang Li 2026-06-22 17:48:22 +08:00 committed by Mark Brown
parent 612ccf42ac
commit 3a89ddcf0c
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -170,6 +170,7 @@ static int psc_i2s_of_probe(struct platform_device *op)
psc_i2s_dai, ARRAY_SIZE(psc_i2s_dai));
if (rc != 0) {
pr_err("Failed to register DAI\n");
mpc5200_audio_dma_destroy(op);
return rc;
}