Skip to content

Commit

Permalink
ASoC: ad1836: fix a memory leak if another ad1836 is registered
Browse files Browse the repository at this point in the history
ad1836 is allocated in ad1836_spi_probe() but is not freed if ad1836_register()
return -EINVAL (if another ad1836 is registered).

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Barry Song <21cnbao@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Axel Lin authored and Mark Brown committed Aug 3, 2010
1 parent 992bee4 commit fd3c8ac
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sound/soc/codecs/ad1836.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ static int ad1836_register(struct ad1836_priv *ad1836)

if (ad1836_codec) {
dev_err(codec->dev, "Another ad1836 is registered\n");
kfree(ad1836);
return -EINVAL;
}

Expand Down

0 comments on commit fd3c8ac

Please sign in to comment.