Skip to contentSkip to conversation

ASoC: sta32x: Fix a memory leak if snd_soc_register_codec fails

PATCH New Axel Lin 1 participant 1 message Aug 13, 2011

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 ASoC: sta32x: Fix a memory leak if snd_soc_register_codec fails

---
 sound/soc/codecs/sta32x.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
sound/soc/codecs/sta32x.c +1 -0
index 409d89d..fbd7eb9 100644
@@ -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;
 	}
 
Signature · 1 line
1.7.4.1