提交 a9b977ec 编写于 作者: P Prathyush K 提交者: Mark Brown

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: NPrathyush K <prathyush.k@samsung.com>
Signed-off-by: NPadmavathi Venna <padma.v@samsung.com>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 07961ac7
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册