aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8731.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-09-16 17:11:43 -0400
committerDavid S. Miller <davem@davemloft.net>2008-09-16 17:11:43 -0400
commit2e57572a50a4de41c6cbc879a4866a312d4cd316 (patch)
treec4f58ec96c06642c4b415b881d3f0a3b673d5b44 /sound/soc/codecs/wm8731.c
parent9b2e43ae4e9609f80034dfe8de895045cac52d77 (diff)
parentf948cc6ab9e61a8e88d70ee9aafc690e6d26f92c (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
Conflicts: arch/sparc64/kernel/pci_psycho.c
Diffstat (limited to 'sound/soc/codecs/wm8731.c')
-rw-r--r--sound/soc/codecs/wm8731.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c
index 369d39c3f745..9402fcaf04fa 100644
--- a/sound/soc/codecs/wm8731.c
+++ b/sound/soc/codecs/wm8731.c
@@ -596,10 +596,9 @@ static int wm8731_codec_probe(struct i2c_adapter *adap, int addr, int kind)
596 client_template.addr = addr; 596 client_template.addr = addr;
597 597
598 i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); 598 i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL);
599 if (i2c == NULL) { 599 if (i2c == NULL)
600 kfree(codec);
601 return -ENOMEM; 600 return -ENOMEM;
602 } 601
603 i2c_set_clientdata(i2c, codec); 602 i2c_set_clientdata(i2c, codec);
604 codec->control_data = i2c; 603 codec->control_data = i2c;
605 604
@@ -617,7 +616,6 @@ static int wm8731_codec_probe(struct i2c_adapter *adap, int addr, int kind)
617 return ret; 616 return ret;
618 617
619err: 618err:
620 kfree(codec);
621 kfree(i2c); 619 kfree(i2c);
622 return ret; 620 return ret;
623} 621}
@@ -693,6 +691,11 @@ static int wm8731_probe(struct platform_device *pdev)
693#else 691#else
694 /* Add other interfaces here */ 692 /* Add other interfaces here */
695#endif 693#endif
694
695 if (ret != 0) {
696 kfree(codec->private_data);
697 kfree(codec);
698 }
696 return ret; 699 return ret;
697} 700}
698 701