summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8990.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-09-04 17:09:09 +0200
committerH. Peter Anvin <hpa@zytor.com>2008-09-04 17:09:09 +0200
commit0ccd8c39bc664bf5e9fcc26caad50cc17ff866d1 (patch)
tree29cec0edf3acf18c6978b750a8d6560f445df6df /sound/soc/codecs/wm8990.c
parentx86: move dir es7000 to es7000_32.c (diff)
parentSplit up PIT part of TSC calibration from native_calibrate_tsc (diff)
downloadlinux-0ccd8c39bc664bf5e9fcc26caad50cc17ff866d1.tar.xz
linux-0ccd8c39bc664bf5e9fcc26caad50cc17ff866d1.zip
Merge branch 'linus' into x86/core
Diffstat (limited to 'sound/soc/codecs/wm8990.c')
-rw-r--r--sound/soc/codecs/wm8990.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm8990.c b/sound/soc/codecs/wm8990.c
index e44153fa38de..dd995ef448b4 100644
--- a/sound/soc/codecs/wm8990.c
+++ b/sound/soc/codecs/wm8990.c
@@ -1500,10 +1500,9 @@ static int wm8990_codec_probe(struct i2c_adapter *adap, int addr, int kind)
client_template.addr = addr;
i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL);
- if (i2c == NULL) {
- kfree(codec);
+ if (i2c == NULL)
return -ENOMEM;
- }
+
i2c_set_clientdata(i2c, codec);
codec->control_data = i2c;
@@ -1521,7 +1520,6 @@ static int wm8990_codec_probe(struct i2c_adapter *adap, int addr, int kind)
return ret;
err:
- kfree(codec);
kfree(i2c);
return ret;
}
@@ -1595,6 +1593,11 @@ static int wm8990_probe(struct platform_device *pdev)
#else
/* Add other interfaces here */
#endif
+
+ if (ret != 0) {
+ kfree(codec->private_data);
+ kfree(codec);
+ }
return ret;
}