summaryrefslogtreecommitdiff
path: root/sound/soc
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2015-12-20 12:15:51 +0100
committerMark Brown <broonie@kernel.org>2015-12-23 00:02:04 +0000
commit18c94a043d6a466938f13761081a5cbee802dad1 (patch)
tree339f28bf000357a3745bd343dc308de39b09db7c /sound/soc
parent10974ccf04b096fd79ad90fd50276b79c069f2cc (diff)
ASoC: omap-hdmi-audio: add NULL test
Add NULL test on call to devm_kzalloc. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression x; identifier fld; @@ * x = devm_kzalloc(...); ... when != x == NULL x->fld // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/omap/omap-hdmi-audio.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/omap/omap-hdmi-audio.c b/sound/soc/omap/omap-hdmi-audio.c
index 584b2372339e..f83cc2bc0fc4 100644
--- a/sound/soc/omap/omap-hdmi-audio.c
+++ b/sound/soc/omap/omap-hdmi-audio.c
@@ -368,6 +368,8 @@ static int omap_hdmi_audio_probe(struct platform_device *pdev)
card->owner = THIS_MODULE;
card->dai_link =
devm_kzalloc(dev, sizeof(*(card->dai_link)), GFP_KERNEL);
+ if (!card->dai_link)
+ return -ENOMEM;
card->dai_link->name = card->name;
card->dai_link->stream_name = card->name;
card->dai_link->cpu_dai_name = dev_name(ad->dssdev);