提交 914dc182 编写于 作者: M Mike Rapoport 提交者: Mark Brown

ASoC: soc-core: fix crash when removing not instantiated card

If the card was not instantiated in snd_soc_instantiate_card, calling
soc-remove will crash because some of codec, cpu_dai and card .remove
methods are called twice.
Fix this by returning from soc_remove immediately.
Signed-off-by: NMike Rapoport <mike@compulab.co.il>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 97a775c4
......@@ -954,6 +954,9 @@ static int soc_remove(struct platform_device *pdev)
struct snd_soc_platform *platform = card->platform;
struct snd_soc_codec_device *codec_dev = socdev->codec_dev;
if (!card->instantiated)
return 0;
run_delayed_work(&card->delayed_work);
if (platform->remove)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册