summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-10-30 08:34:59 +0100
committerMark Brown <broonie@linaro.org>2013-10-30 09:33:30 -0700
commit00ecdd93a80fda1336bf5413b1d705c742a5b598 (patch)
treedb264c24a70c1bb69e4867b5554d7988d814f480 /sound
parent2245e3c31c15c2d2a26926c4b734f4d3a37ae252 (diff)
downloadlinux-00ecdd93a80fda1336bf5413b1d705c742a5b598.tar.bz2
ASoC: ab8500: Add missing of NULL check of devm_kzalloc()
Spotted by coverity CID 712316. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/ab8500-codec.c2
1 files changed, 2 insertions, 0 deletions
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);