From: Prathyush K Date: Tue, 2 Apr 2013 11:23:01 +0000 (+0530) Subject: ASoC: Samsung: return error if drvdata is not set X-Git-Tag: upstream/snapshot3+hdmi~5112^2~53^2~33^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a9b977ecd3dbc5d4f0fe0b3d5c66d284859b1f2a;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git ASoC: Samsung: return error if drvdata is not set This patch fixes a possible crash in case drvdata for the secondary device is not set. Signed-off-by: Prathyush K Signed-off-by: Padmavathi Venna Signed-off-by: Mark Brown --- diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index d7231e3..f1fc064 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -1107,6 +1107,10 @@ static int samsung_i2s_probe(struct platform_device *pdev) if (samsung_dai_type == TYPE_SEC) { sec_dai = dev_get_drvdata(&pdev->dev); + if (!sec_dai) { + dev_err(&pdev->dev, "Unable to get drvdata\n"); + return -EFAULT; + } snd_soc_register_dai(&sec_dai->pdev->dev, &sec_dai->i2s_dai_drv); asoc_dma_platform_register(&pdev->dev);