summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Eastwood <manabian@gmail.com>2011-06-01 21:59:10 (GMT)
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-06-03 09:04:17 (GMT)
commit840d8e5e964dc51673d0f26e119b27d2898e8417 (patch)
treefaf9c6876a6ac09ad8ca4b4793d97480b0fb843e
parentea02c63d57d7ec099f66ddb2942b4022e865cd5f (diff)
downloadlinux-840d8e5e964dc51673d0f26e119b27d2898e8417.tar.xz
ASoC: atmel_ssc: Don't try to free ssc if request failed
We should only call ssc_free() when ssc_request() succeeds or bad things will happen. Signed-off-by: Joachim Eastwood <joachim.eastwood@jotron.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--sound/soc/atmel/atmel_ssc_dai.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c
index 7fbfa05..eda955b 100644
--- a/sound/soc/atmel/atmel_ssc_dai.c
+++ b/sound/soc/atmel/atmel_ssc_dai.c
@@ -848,9 +848,10 @@ int atmel_ssc_set_audio(int ssc_id)
if (IS_ERR(ssc))
pr_warn("Unable to parent ASoC SSC DAI on SSC: %ld\n",
PTR_ERR(ssc));
- else
+ else {
ssc_pdev->dev.parent = &(ssc->pdev->dev);
- ssc_free(ssc);
+ ssc_free(ssc);
+ }
ret = platform_device_add(ssc_pdev);
if (ret < 0)