From: Arvind Yadav Date: Wed, 20 Sep 2017 10:06:11 +0000 (+0530) Subject: ASoC: omap-hdmi-audio: Handle return value of devm_kasprintf X-Git-Tag: v4.15-rc1~118^2~1^2~4^5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=94a6a8e8b57a8ece33b97a6dfc5f7eae61ff96f8;p=thirdparty%2Fkernel%2Flinux.git ASoC: omap-hdmi-audio: Handle return value of devm_kasprintf devm_kasprintf() can fail here and we must check its return value. Signed-off-by: Arvind Yadav Signed-off-by: Mark Brown --- diff --git a/sound/soc/omap/omap-hdmi-audio.c b/sound/soc/omap/omap-hdmi-audio.c index 3e9cc4842a1db..8eeac7cab1c19 100644 --- a/sound/soc/omap/omap-hdmi-audio.c +++ b/sound/soc/omap/omap-hdmi-audio.c @@ -362,6 +362,9 @@ static int omap_hdmi_audio_probe(struct platform_device *pdev) card->name = devm_kasprintf(dev, GFP_KERNEL, "HDMI %s", dev_name(ad->dssdev)); + if (!card->name) + return -ENOMEM; + card->owner = THIS_MODULE; card->dai_link = devm_kzalloc(dev, sizeof(*(card->dai_link)), GFP_KERNEL);