From: Joachim Eastwood Date: Wed, 1 Jun 2011 21:59:10 +0000 (+0200) Subject: ASoC: atmel_ssc: Don't try to free ssc if request failed X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=840d8e5e964dc51673d0f26e119b27d2898e8417;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git 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 Acked-by: Liam Girdwood Signed-off-by: Mark Brown --- diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index 7fbfa051f6e..eda955b1583 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)