* [PATCH] ASoC: sta32x: Fix a memory leak if snd_soc_register_codec fails
@ 2011-08-13 3:33 Axel Lin
0 siblings, 0 replies; only message in thread
From: Axel Lin @ 2011-08-13 3:33 UTC (permalink / raw)
To: linux-kernel; +Cc: Liam Girdwood, Mark Brown, Johannes Stezenbach, alsa-devel
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
sound/soc/codecs/sta32x.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/sound/soc/codecs/sta32x.c b/sound/soc/codecs/sta32x.c
index 409d89d..fbd7eb9 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;
}
--
1.7.4.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-08-13 3:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-13 3:33 [PATCH] ASoC: sta32x: Fix a memory leak if snd_soc_register_codec fails Axel Lin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox