From: Vishal Thanki Date: Tue, 3 Mar 2015 13:29:00 +0000 (+0530) Subject: ASoC: simple-card: Add a NULL pointer check in asoc_simple_card_dai_link_of X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=31f3032c1a5504259f6fa8e0c7f8d2d3e2f5db48;p=linux-beck.git 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 Signed-off-by: Mark Brown --- 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;