diff options
Diffstat (limited to 'sound/soc/codecs/wm8750.c')
-rw-r--r-- | sound/soc/codecs/wm8750.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm8750.c b/sound/soc/codecs/wm8750.c index c6a8edf302ad..dd1f55404b29 100644 --- a/sound/soc/codecs/wm8750.c +++ b/sound/soc/codecs/wm8750.c | |||
@@ -869,10 +869,9 @@ static int wm8750_codec_probe(struct i2c_adapter *adap, int addr, int kind) | |||
869 | client_template.addr = addr; | 869 | client_template.addr = addr; |
870 | 870 | ||
871 | i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); | 871 | i2c = kmemdup(&client_template, sizeof(client_template), GFP_KERNEL); |
872 | if (i2c == NULL) { | 872 | if (i2c == NULL) |
873 | kfree(codec); | ||
874 | return -ENOMEM; | 873 | return -ENOMEM; |
875 | } | 874 | |
876 | i2c_set_clientdata(i2c, codec); | 875 | i2c_set_clientdata(i2c, codec); |
877 | codec->control_data = i2c; | 876 | codec->control_data = i2c; |
878 | 877 | ||
@@ -890,7 +889,6 @@ static int wm8750_codec_probe(struct i2c_adapter *adap, int addr, int kind) | |||
890 | return ret; | 889 | return ret; |
891 | 890 | ||
892 | err: | 891 | err: |
893 | kfree(codec); | ||
894 | kfree(i2c); | 892 | kfree(i2c); |
895 | return ret; | 893 | return ret; |
896 | } | 894 | } |
@@ -966,6 +964,10 @@ static int wm8750_probe(struct platform_device *pdev) | |||
966 | /* Add other interfaces here */ | 964 | /* Add other interfaces here */ |
967 | #endif | 965 | #endif |
968 | 966 | ||
967 | if (ret != 0) { | ||
968 | kfree(codec->private_data); | ||
969 | kfree(codec); | ||
970 | } | ||
969 | return ret; | 971 | return ret; |
970 | } | 972 | } |
971 | 973 | ||