Skip to content

Commit

Permalink
Merge remote-tracking branch 'asoc/fix/dapm' into asoc-linus
Browse files Browse the repository at this point in the history
  • Loading branch information
broonie committed Oct 8, 2014
2 parents b9fb729 + e5092c9 commit 699f858
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions sound/soc/soc-dapm.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,9 +592,9 @@ static int dapm_create_or_share_mixmux_kcontrol(struct snd_soc_dapm_widget *w,
int shared;
struct snd_kcontrol *kcontrol;
bool wname_in_long_name, kcname_in_long_name;
char *long_name;
char *long_name = NULL;
const char *name;
int ret;
int ret = 0;

prefix = soc_dapm_prefix(dapm);
if (prefix)
Expand Down Expand Up @@ -653,33 +653,36 @@ static int dapm_create_or_share_mixmux_kcontrol(struct snd_soc_dapm_widget *w,

kcontrol = snd_soc_cnew(&w->kcontrol_news[kci], NULL, name,
prefix);
kfree(long_name);
if (!kcontrol)
return -ENOMEM;
if (!kcontrol) {
ret = -ENOMEM;
goto exit_free;
}

kcontrol->private_free = dapm_kcontrol_free;

ret = dapm_kcontrol_data_alloc(w, kcontrol);
if (ret) {
snd_ctl_free_one(kcontrol);
return ret;
goto exit_free;
}

ret = snd_ctl_add(card, kcontrol);
if (ret < 0) {
dev_err(dapm->dev,
"ASoC: failed to add widget %s dapm kcontrol %s: %d\n",
w->name, name, ret);
return ret;
goto exit_free;
}
}

ret = dapm_kcontrol_add_widget(kcontrol, w);
if (ret)
return ret;
if (ret == 0)
w->kcontrols[kci] = kcontrol;

w->kcontrols[kci] = kcontrol;
exit_free:
kfree(long_name);

return 0;
return ret;
}

/* create new dapm mixer control */
Expand Down

0 comments on commit 699f858

Please sign in to comment.