projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
62f5ad6
)
ASoC: wm8940: fix a memory leak if wm8940_register return error
author
Axel Lin
<
[email protected]
>
Fri, 23 Jul 2010 05:53:49 +0000
(
05:53
+0000)
committer
Mark Brown
<
[email protected]
>
Tue, 3 Aug 2010 06:45:20 +0000
(07:45 +0100)
This patch adds checking for wm8940_register return value,
and does kfree(wm8940) if wm8940_register() fail.
Signed-off-by: Axel Lin <
[email protected]
>
Acked-by: Liam Girdwood <
[email protected]
>
Signed-off-by: Mark Brown <
[email protected]
>
sound/soc/codecs/wm8940.c
patch
|
blob
|
history
diff --git
a/sound/soc/codecs/wm8940.c
b/sound/soc/codecs/wm8940.c
index e3c4bbfaae273db4502dfaa58c2e29971271e3f3..f0c11138e61002cf2c6a0f419c64de177f0e9a62 100644
(file)
--- a/
sound/soc/codecs/wm8940.c
+++ b/
sound/soc/codecs/wm8940.c
@@
-845,6
+845,7
@@
static void wm8940_unregister(struct wm8940_priv *wm8940)
static int wm8940_i2c_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
{
+ int ret;
struct wm8940_priv *wm8940;
struct snd_soc_codec *codec;
@@
-858,7
+859,11
@@
static int wm8940_i2c_probe(struct i2c_client *i2c,
codec->control_data = i2c;
codec->dev = &i2c->dev;
- return wm8940_register(wm8940, SND_SOC_I2C);
+ ret = wm8940_register(wm8940, SND_SOC_I2C);
+ if (ret < 0)
+ kfree(wm8940);
+
+ return ret;
}
static int __devexit wm8940_i2c_remove(struct i2c_client *client)