diff options
author | Vishal Thanki <vishalthanki@gmail.com> | 2015-03-03 08:29:00 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-03-03 09:25:16 -0500 |
commit | 31f3032c1a5504259f6fa8e0c7f8d2d3e2f5db48 (patch) | |
tree | 3d3a82320cb4c6506b42fc88a29ca3a730fdc5a7 /sound | |
parent | c517d838eb7d07bbe9507871fab3931deccff539 (diff) |
ASoC: simple-card: Add a NULL pointer check in asoc_simple_card_dai_link_of
Make sure devm_kzalloc() succeeds.
Signed-off-by: Vishal Thanki <vishalthanki@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/generic/simple-card.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index f7c6734bd5da..fb550b5869d2 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c | |||
@@ -372,6 +372,11 @@ static int asoc_simple_card_dai_link_of(struct device_node *node, | |||
372 | strlen(dai_link->cpu_dai_name) + | 372 | strlen(dai_link->cpu_dai_name) + |
373 | strlen(dai_link->codec_dai_name) + 2, | 373 | strlen(dai_link->codec_dai_name) + 2, |
374 | GFP_KERNEL); | 374 | GFP_KERNEL); |
375 | if (!name) { | ||
376 | ret = -ENOMEM; | ||
377 | goto dai_link_of_err; | ||
378 | } | ||
379 | |||
375 | sprintf(name, "%s-%s", dai_link->cpu_dai_name, | 380 | sprintf(name, "%s-%s", dai_link->cpu_dai_name, |
376 | dai_link->codec_dai_name); | 381 | dai_link->codec_dai_name); |
377 | dai_link->name = dai_link->stream_name = name; | 382 | dai_link->name = dai_link->stream_name = name; |