diff options
-rw-r--r-- | sound/soc/generic/simple-card.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 7a9b6b4898c0..be7c1db5388f 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c | |||
@@ -142,6 +142,9 @@ static int asoc_simple_card_parse_of(struct device_node *node, | |||
142 | if (ret < 0) | 142 | if (ret < 0) |
143 | return ret; | 143 | return ret; |
144 | 144 | ||
145 | if (!info->cpu_dai.name || !info->codec_dai.name) | ||
146 | return -EINVAL; | ||
147 | |||
145 | /* card name is created from CPU/CODEC dai name */ | 148 | /* card name is created from CPU/CODEC dai name */ |
146 | name = devm_kzalloc(dev, | 149 | name = devm_kzalloc(dev, |
147 | strlen(info->cpu_dai.name) + | 150 | strlen(info->cpu_dai.name) + |