diff options
author | Steve French <sfrench@us.ibm.com> | 2008-08-26 16:56:05 +0000 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2008-08-26 16:56:05 +0000 |
commit | 3dae49abef945c55c10fa7c479cfd8fd13af55db (patch) | |
tree | 487c47c6d23cc28a259b913396aeaff0b792d32d /sound/soc/codecs/wm8510.c | |
parent | 6ce5eecb9cd3ac97b952c50309b87c31488a45e9 (diff) | |
parent | b8e6c91c74e9f0279b7c51048779b3d62da60b88 (diff) |
Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'sound/soc/codecs/wm8510.c')
-rw-r--r-- | sound/soc/codecs/wm8510.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm8510.c b/sound/soc/codecs/wm8510.c index 67325fd9544..3d998e6a997 100644 --- a/sound/soc/codecs/wm8510.c +++ b/sound/soc/codecs/wm8510.c @@ -693,10 +693,9 @@ static int wm8510_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; @@ -714,7 +713,6 @@ static int wm8510_codec_probe(struct i2c_adapter *adap, int addr, int kind) return ret; err: - kfree(codec); kfree(i2c); return ret; } @@ -782,6 +780,9 @@ static int wm8510_probe(struct platform_device *pdev) #else /* Add other interfaces here */ #endif + + if (ret != 0) + kfree(codec); return ret; } |