From: Takashi Iwai Date: Wed, 30 Oct 2013 07:34:59 +0000 (+0100) Subject: ASoC: ab8500: Add missing of NULL check of devm_kzalloc() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=00ecdd93a80fda1336bf5413b1d705c742a5b598;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ASoC: ab8500: Add missing of NULL check of devm_kzalloc() Spotted by coverity CID 712316. Signed-off-by: Takashi Iwai Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/ab8500-codec.c b/sound/soc/codecs/ab8500-codec.c index 7f6ca111659b..10be4cbfe969 100644 --- a/sound/soc/codecs/ab8500-codec.c +++ b/sound/soc/codecs/ab8500-codec.c @@ -2570,6 +2570,8 @@ static int ab8500_codec_driver_probe(struct platform_device *pdev) /* Create driver private-data struct */ drvdata = devm_kzalloc(&pdev->dev, sizeof(struct ab8500_codec_drvdata), GFP_KERNEL); + if (!drvdata) + return -ENOMEM; drvdata->sid_status = SID_UNCONFIGURED; drvdata->anc_status = ANC_UNCONFIGURED; dev_set_drvdata(&pdev->dev, drvdata);