Skip to content

Commit

Permalink
ASoC: atmel_ssc_dai: fix ssc error path
Browse files Browse the repository at this point in the history
We do not have to free a resource that is not allocated yet.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Nicolas Ferre authored and Mark Brown committed May 26, 2011
1 parent 97b4fc3 commit 2cdcd95
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions sound/soc/atmel/atmel_ssc_dai.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2cdcd95

Please sign in to comment.