summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVishal Thanki <vishalthanki@gmail.com>2015-03-03 14:29:00 +0100
committerMark Brown <broonie@kernel.org>2015-03-03 16:38:41 +0100
commit0004defd4e44d81966b0c4164c2ee01f20ab357b (patch)
tree3d3a82320cb4c6506b42fc88a29ca3a730fdc5a7
parentLinux 4.0-rc1 (diff)
downloadlinux-0004defd4e44d81966b0c4164c2ee01f20ab357b.tar.xz
linux-0004defd4e44d81966b0c4164c2ee01f20ab357b.zip
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>
-rw-r--r--sound/soc/generic/simple-card.c5
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,
strlen(dai_link->cpu_dai_name) +
strlen(dai_link->codec_dai_name) + 2,
GFP_KERNEL);
+ if (!name) {
+ ret = -ENOMEM;
+ goto dai_link_of_err;
+ }
+
sprintf(name, "%s-%s", dai_link->cpu_dai_name,
dai_link->codec_dai_name);
dai_link->name = dai_link->stream_name = name;