diff options
author | Mike Rapoport <mike@compulab.co.il> | 2009-05-11 06:04:55 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-05-11 14:01:51 -0400 |
commit | 914dc18255e430ceabb10b57394e01814c69c5cd (patch) | |
tree | 469a8a5ca346aa9fc7a119457222549b42a91898 | |
parent | 97a775c49c7e1b47b016a492463486a5b86da479 (diff) |
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: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | sound/soc/soc-core.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 99712f652d0d..1cd149b9ce69 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -954,6 +954,9 @@ static int soc_remove(struct platform_device *pdev) | |||
954 | struct snd_soc_platform *platform = card->platform; | 954 | struct snd_soc_platform *platform = card->platform; |
955 | struct snd_soc_codec_device *codec_dev = socdev->codec_dev; | 955 | struct snd_soc_codec_device *codec_dev = socdev->codec_dev; |
956 | 956 | ||
957 | if (!card->instantiated) | ||
958 | return 0; | ||
959 | |||
957 | run_delayed_work(&card->delayed_work); | 960 | run_delayed_work(&card->delayed_work); |
958 | 961 | ||
959 | if (platform->remove) | 962 | if (platform->remove) |