Skip to content

Commit 7506bae

Browse files
JuliaLawallbroonie
authored andcommitted
ASoC: stm32: sai: Add missing cleanup
The commit 0d6defc ("ASoC: stm32: sai: manage rebind issue") converts some function calls to their non-devm equivalents. The appropriate cleanup code was added to the remove function, but not to the probe function. Add a call to snd_dmaengine_pcm_unregister to compensate for the call to snd_dmaengine_pcm_register in case of subsequent failure. Fixes: commit 0d6defc ("ASoC: stm32: sai: manage rebind issue") Signed-off-by: Julia Lawall <[email protected]> Acked-by: Olivier Moysan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent c515291 commit 7506bae

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sound/soc/stm/stm32_sai_sub.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1556,8 +1556,10 @@ static int stm32_sai_sub_probe(struct platform_device *pdev)
15561556

15571557
ret = snd_soc_register_component(&pdev->dev, &stm32_component,
15581558
&sai->cpu_dai_drv, 1);
1559-
if (ret)
1559+
if (ret) {
1560+
snd_dmaengine_pcm_unregister(&pdev->dev);
15601561
return ret;
1562+
}
15611563

15621564
if (STM_SAI_PROTOCOL_IS_SPDIF(sai))
15631565
conf = &stm32_sai_pcm_config_spdif;

0 commit comments

Comments
 (0)