summaryrefslogtreecommitdiff
path: root/sound/soc
diff options
context:
space:
mode:
authorKiran Padwal <kiran.padwal@smartplayin.com>2015-02-12 14:38:02 +0530
committerMark Brown <broonie@kernel.org>2015-02-14 13:32:53 +0900
commitfb5ab7296a2bea17c38fae48af2808a07049ac90 (patch)
treebdecae4a8df01ba4d5271f539565d1ad44473166 /sound/soc
parentbfa76d49576599a4b9f9b7a71f23d73d6dcff735 (diff)
ASoC: omap-hdmi-audio: Add missing error check for devm_kzalloc
This patch add a missing check on the return value of devm_kzalloc, which would cause a NULL pointer dereference in a OOM situation. Signed-off-by: Kiran Padwal <kiran.padwal@smartplayin.com> 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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/omap/omap-hdmi-audio.c b/sound/soc/omap/omap-hdmi-audio.c
index 3f9ac7dbdc80..069ad451d05d 100644
--- a/sound/soc/omap/omap-hdmi-audio.c
+++ b/sound/soc/omap/omap-hdmi-audio.c
@@ -352,6 +352,9 @@ static int omap_hdmi_audio_probe(struct platform_device *pdev)
return ret;
card = devm_kzalloc(dev, sizeof(*card), GFP_KERNEL);
+ if (!card)
+ return -ENOMEM;
+
card->name = devm_kasprintf(dev, GFP_KERNEL,
"HDMI %s", dev_name(ad->dssdev));
card->owner = THIS_MODULE;