diff options
author | David S. Miller <davem@davemloft.net> | 2008-09-16 17:11:43 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-09-16 17:11:43 -0400 |
commit | 2e57572a50a4de41c6cbc879a4866a312d4cd316 (patch) | |
tree | c4f58ec96c06642c4b415b881d3f0a3b673d5b44 /sound/soc/codecs/ak4535.c | |
parent | 9b2e43ae4e9609f80034dfe8de895045cac52d77 (diff) | |
parent | f948cc6ab9e61a8e88d70ee9aafc690e6d26f92c (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/ak4535.c')
-rw-r--r-- | sound/soc/codecs/ak4535.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sound/soc/codecs/ak4535.c b/sound/soc/codecs/ak4535.c index b26003c4f3e8..7da9f467b7b8 100644 --- a/sound/soc/codecs/ak4535.c +++ b/sound/soc/codecs/ak4535.c | |||
@@ -562,10 +562,9 @@ static int ak4535_codec_probe(struct i2c_adapter *adap, int addr, int kind) | |||
562 | client_template.addr = addr; | 562 | client_template.addr = addr; |
563 | 563 | ||
564 | i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); | 564 | i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); |
565 | if (i2c == NULL) { | 565 | if (i2c == NULL) |
566 | kfree(codec); | ||
567 | return -ENOMEM; | 566 | return -ENOMEM; |
568 | } | 567 | |
569 | i2c_set_clientdata(i2c, codec); | 568 | i2c_set_clientdata(i2c, codec); |
570 | codec->control_data = i2c; | 569 | codec->control_data = i2c; |
571 | 570 | ||
@@ -583,7 +582,6 @@ static int ak4535_codec_probe(struct i2c_adapter *adap, int addr, int kind) | |||
583 | return ret; | 582 | return ret; |
584 | 583 | ||
585 | err: | 584 | err: |
586 | kfree(codec); | ||
587 | kfree(i2c); | 585 | kfree(i2c); |
588 | return ret; | 586 | return ret; |
589 | } | 587 | } |
@@ -660,6 +658,11 @@ static int ak4535_probe(struct platform_device *pdev) | |||
660 | #else | 658 | #else |
661 | /* Add other interfaces here */ | 659 | /* Add other interfaces here */ |
662 | #endif | 660 | #endif |
661 | |||
662 | if (ret != 0) { | ||
663 | kfree(codec->private_data); | ||
664 | kfree(codec); | ||
665 | } | ||
663 | return ret; | 666 | return ret; |
664 | } | 667 | } |
665 | 668 | ||