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>
This commit is contained in:
Takashi Iwai 2013-10-30 08:34:59 +01:00 committed by Mark Brown
parent 2245e3c31c
commit 00ecdd93a8
1 changed files with 2 additions and 0 deletions

View File

@ -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);