diff options
Diffstat (limited to 'sound/soc/codecs/wm8731.c')
-rw-r--r-- | sound/soc/codecs/wm8731.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c index 8151b45a280c..9956d654b6f3 100644 --- a/sound/soc/codecs/wm8731.c +++ b/sound/soc/codecs/wm8731.c | |||
@@ -696,8 +696,8 @@ static int wm8731_init(struct snd_soc_device *socdev) | |||
696 | /* register pcms */ | 696 | /* register pcms */ |
697 | ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1); | 697 | ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1); |
698 | if (ret < 0) { | 698 | if (ret < 0) { |
699 | kfree(codec->reg_cache); | 699 | printk(KERN_ERR "wm8731: failed to create pcms\n"); |
700 | return ret; | 700 | goto pcm_err; |
701 | } | 701 | } |
702 | 702 | ||
703 | /* power on device */ | 703 | /* power on device */ |
@@ -717,11 +717,18 @@ static int wm8731_init(struct snd_soc_device *socdev) | |||
717 | wm8731_add_widgets(codec); | 717 | wm8731_add_widgets(codec); |
718 | ret = snd_soc_register_card(socdev); | 718 | ret = snd_soc_register_card(socdev); |
719 | if (ret < 0) { | 719 | if (ret < 0) { |
720 | snd_soc_free_pcms(socdev); | 720 | printk(KERN_ERR "wm8731: failed to register card\n"); |
721 | snd_soc_dapm_free(socdev); | 721 | goto card_err; |
722 | } | 722 | } |
723 | 723 | ||
724 | return ret; | 724 | return ret; |
725 | |||
726 | card_err: | ||
727 | snd_soc_free_pcms(socdev); | ||
728 | snd_soc_dapm_free(socdev); | ||
729 | pcm_err: | ||
730 | kfree(codec->reg_cache); | ||
731 | return ret; | ||
725 | } | 732 | } |
726 | 733 | ||
727 | static struct snd_soc_device *wm8731_socdev; | 734 | static struct snd_soc_device *wm8731_socdev; |