From: Nicolas Ferre Date: Thu, 26 May 2011 11:44:12 +0000 (+0200) Subject: ASoC: atmel_ssc_dai: fix ssc error path X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2cdcd951c456fecbeb11fc42aa7d90f172dc58ef;p=mv-sheeva.git ASoC: atmel_ssc_dai: fix ssc error path We do not have to free a resource that is not allocated yet. Signed-off-by: Nicolas Ferre 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..a7a7bbc0762 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c @@ -838,10 +838,8 @@ int atmel_ssc_set_audio(int ssc_id) } ssc_pdev = platform_device_alloc("atmel-ssc-dai", ssc_id); - if (!ssc_pdev) { - ssc_free(ssc); + if (!ssc_pdev) return -ENOMEM; - } /* If we can grab the SSC briefly to parent the DAI device off it */ ssc = ssc_request(ssc_id);