blob: 855e00333abea076d4dcf3233552b400e30a7272 [file] [log] [blame]
From 519d9421946e8026886b39b10cdb908ba3c5d8fe Mon Sep 17 00:00:00 2001
From: Julia Lawall <>
Date: Sun, 5 Apr 2020 17:03:48 +0200
Subject: [PATCH] ASoC: stm32: sai: Add missing cleanup
commit 7506baeed8d05fc164254c64af14cfed2ac14446 upstream.
The commit 0d6defc7e0e4 ("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 0d6defc7e0e4 ("ASoC: stm32: sai: manage rebind issue")
Signed-off-by: Julia Lawall <>
Acked-by: Olivier Moysan <>
Signed-off-by: Mark Brown <>
Signed-off-by: Paul Gortmaker <>
diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c
index b90a046b2bc6..77547aa0b18f 100644
--- a/sound/soc/stm/stm32_sai_sub.c
+++ b/sound/soc/stm/stm32_sai_sub.c
@@ -1548,8 +1548,10 @@ static int stm32_sai_sub_probe(struct platform_device *pdev)
ret = snd_soc_register_component(&pdev->dev, &stm32_component,
&sai->cpu_dai_drv, 1);
- if (ret)
+ if (ret) {
+ snd_dmaengine_pcm_unregister(&pdev->dev);
return ret;
+ }
conf = &stm32_sai_pcm_config_spdif;