diff options
| -rw-r--r-- | sound/soc/soc-dapm.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index defe0f0082b5..158204d08924 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
| @@ -3100,11 +3100,16 @@ snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm, | |||
| 3100 | } | 3100 | } |
| 3101 | 3101 | ||
| 3102 | prefix = soc_dapm_prefix(dapm); | 3102 | prefix = soc_dapm_prefix(dapm); |
| 3103 | if (prefix) | 3103 | if (prefix) { |
| 3104 | w->name = kasprintf(GFP_KERNEL, "%s %s", prefix, widget->name); | 3104 | w->name = kasprintf(GFP_KERNEL, "%s %s", prefix, widget->name); |
| 3105 | else | 3105 | if (widget->sname) |
| 3106 | w->sname = kasprintf(GFP_KERNEL, "%s %s", prefix, | ||
| 3107 | widget->sname); | ||
| 3108 | } else { | ||
| 3106 | w->name = kasprintf(GFP_KERNEL, "%s", widget->name); | 3109 | w->name = kasprintf(GFP_KERNEL, "%s", widget->name); |
| 3107 | 3110 | if (widget->sname) | |
| 3111 | w->sname = kasprintf(GFP_KERNEL, "%s", widget->sname); | ||
| 3112 | } | ||
| 3108 | if (w->name == NULL) { | 3113 | if (w->name == NULL) { |
| 3109 | kfree(w); | 3114 | kfree(w); |
| 3110 | return NULL; | 3115 | return NULL; |
