From: Axel Lin Date: Sat, 13 Aug 2011 03:33:08 +0000 (+0800) Subject: ASoC: sta32x: Fix a memory leak if snd_soc_register_codec fails X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=161d55c3ec4c7e26c96b11dc86caea0b3c9c6b0f;p=linux-beck.git ASoC: sta32x: Fix a memory leak if snd_soc_register_codec fails Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/sta32x.c b/sound/soc/codecs/sta32x.c index 409d89d1f34c..fbd7eb9e61ce 100644 --- a/sound/soc/codecs/sta32x.c +++ b/sound/soc/codecs/sta32x.c @@ -857,6 +857,7 @@ static __devinit int sta32x_i2c_probe(struct i2c_client *i2c, ret = snd_soc_register_codec(&i2c->dev, &sta32x_codec, &sta32x_dai, 1); if (ret != 0) { dev_err(&i2c->dev, "Failed to register codec (%d)\n", ret); + kfree(sta32x); return ret; }