Skip to content

Commit

Permalink
ASoC: stm32: sai: Add missing cleanup
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
JuliaLawall authored and broonie committed Apr 6, 2020
1 parent c515291 commit 7506bae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sound/soc/stm/stm32_sai_sub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1556,8 +1556,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;
}

if (STM_SAI_PROTOCOL_IS_SPDIF(sai))
conf = &stm32_sai_pcm_config_spdif;
Expand Down

0 comments on commit 7506bae

Please sign in to comment.