From 00ecdd93a80fda1336bf5413b1d705c742a5b598 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 30 Oct 2013 08:34:59 +0100 Subject: [PATCH] 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 --- sound/soc/codecs/ab8500-codec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/codecs/ab8500-codec.c b/sound/soc/codecs/ab8500-codec.c index 7f6ca111659..10be4cbfe96 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); -- 2.41.0