summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/ab8500-codec.c
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 17:33:30 +0100
commit00ecdd93a80fda1336bf5413b1d705c742a5b598 (patch)
treedb264c24a70c1bb69e4867b5554d7988d814f480 /sound/soc/codecs/ab8500-codec.c
parentASoC: ab8500: Explicitly set I/O up (diff)
downloadlinux-00ecdd93a80fda1336bf5413b1d705c742a5b598.tar.xz
linux-00ecdd93a80fda1336bf5413b1d705c742a5b598.zip
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/soc/codecs/ab8500-codec.c')
-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);