Skip to content

Commit

Permalink
ASoC: Samsung: return error if drvdata is not set
Browse files Browse the repository at this point in the history
This patch fixes a possible crash in case drvdata for the secondary
device is not set.

Signed-off-by: Prathyush K <prathyush.k@samsung.com>
Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
sribconnect authored and broonie committed Apr 3, 2013
1 parent 07961ac commit a9b977e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sound/soc/samsung/i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a9b977e

Please sign in to comment.