diff options
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r-- | sound/soc/soc-dapm.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 8240ab853d78..570db8819d9b 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -1517,7 +1517,7 @@ static int snd_soc_dapm_add_route(struct snd_soc_dapm_context *dapm, | |||
1517 | char prefixed_source[80]; | 1517 | char prefixed_source[80]; |
1518 | int ret = 0; | 1518 | int ret = 0; |
1519 | 1519 | ||
1520 | if (dapm->codec->name_prefix) { | 1520 | if (dapm->codec && dapm->codec->name_prefix) { |
1521 | snprintf(prefixed_sink, sizeof(prefixed_sink), "%s %s", | 1521 | snprintf(prefixed_sink, sizeof(prefixed_sink), "%s %s", |
1522 | dapm->codec->name_prefix, route->sink); | 1522 | dapm->codec->name_prefix, route->sink); |
1523 | sink = prefixed_sink; | 1523 | sink = prefixed_sink; |
@@ -2167,14 +2167,14 @@ int snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm, | |||
2167 | return -ENOMEM; | 2167 | return -ENOMEM; |
2168 | 2168 | ||
2169 | name_len = strlen(widget->name) + 1; | 2169 | name_len = strlen(widget->name) + 1; |
2170 | if (dapm->codec->name_prefix) | 2170 | if (dapm->codec && dapm->codec->name_prefix) |
2171 | name_len += 1 + strlen(dapm->codec->name_prefix); | 2171 | name_len += 1 + strlen(dapm->codec->name_prefix); |
2172 | w->name = kmalloc(name_len, GFP_KERNEL); | 2172 | w->name = kmalloc(name_len, GFP_KERNEL); |
2173 | if (w->name == NULL) { | 2173 | if (w->name == NULL) { |
2174 | kfree(w); | 2174 | kfree(w); |
2175 | return -ENOMEM; | 2175 | return -ENOMEM; |
2176 | } | 2176 | } |
2177 | if (dapm->codec->name_prefix) | 2177 | if (dapm->codec && dapm->codec->name_prefix) |
2178 | snprintf(w->name, name_len, "%s %s", | 2178 | snprintf(w->name, name_len, "%s %s", |
2179 | dapm->codec->name_prefix, widget->name); | 2179 | dapm->codec->name_prefix, widget->name); |
2180 | else | 2180 | else |