2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-07 21:24:00 +08:00

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>
This commit is contained in:
Kiran Padwal 2015-02-12 14:38:02 +05:30 committed by Mark Brown
parent bfa76d4957
commit fb5ab7296a

View File

@ -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;