diff options
Diffstat (limited to 'sound/soc/codecs/wm8753.c')
-rw-r--r-- | sound/soc/codecs/wm8753.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c index 8604809f0c36..5761164fe16d 100644 --- a/sound/soc/codecs/wm8753.c +++ b/sound/soc/codecs/wm8753.c | |||
@@ -34,7 +34,6 @@ | |||
34 | 34 | ||
35 | #include <linux/module.h> | 35 | #include <linux/module.h> |
36 | #include <linux/moduleparam.h> | 36 | #include <linux/moduleparam.h> |
37 | #include <linux/version.h> | ||
38 | #include <linux/kernel.h> | 37 | #include <linux/kernel.h> |
39 | #include <linux/init.h> | 38 | #include <linux/init.h> |
40 | #include <linux/delay.h> | 39 | #include <linux/delay.h> |
@@ -1661,10 +1660,9 @@ static int wm8753_codec_probe(struct i2c_adapter *adap, int addr, int kind) | |||
1661 | client_template.addr = addr; | 1660 | client_template.addr = addr; |
1662 | 1661 | ||
1663 | i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); | 1662 | i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); |
1664 | if (!i2c) { | 1663 | if (!i2c) |
1665 | kfree(codec); | ||
1666 | return -ENOMEM; | 1664 | return -ENOMEM; |
1667 | } | 1665 | |
1668 | i2c_set_clientdata(i2c, codec); | 1666 | i2c_set_clientdata(i2c, codec); |
1669 | codec->control_data = i2c; | 1667 | codec->control_data = i2c; |
1670 | 1668 | ||
@@ -1683,7 +1681,6 @@ static int wm8753_codec_probe(struct i2c_adapter *adap, int addr, int kind) | |||
1683 | return ret; | 1681 | return ret; |
1684 | 1682 | ||
1685 | err: | 1683 | err: |
1686 | kfree(codec); | ||
1687 | kfree(i2c); | 1684 | kfree(i2c); |
1688 | return ret; | 1685 | return ret; |
1689 | } | 1686 | } |
@@ -1760,6 +1757,11 @@ static int wm8753_probe(struct platform_device *pdev) | |||
1760 | #else | 1757 | #else |
1761 | /* Add other interfaces here */ | 1758 | /* Add other interfaces here */ |
1762 | #endif | 1759 | #endif |
1760 | |||
1761 | if (ret != 0) { | ||
1762 | kfree(codec->private_data); | ||
1763 | kfree(codec); | ||
1764 | } | ||
1763 | return ret; | 1765 | return ret; |
1764 | } | 1766 | } |
1765 | 1767 | ||