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:
parent
bfa76d4957
commit
fb5ab7296a
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user