diff options
author | Prathyush K <prathyush.k@samsung.com> | 2013-04-02 16:53:01 +0530 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-04-03 17:56:43 +0100 |
commit | a9b977ecd3dbc5d4f0fe0b3d5c66d284859b1f2a (patch) | |
tree | 4336d49e88820a8e3f7ff9ac56377936831d9df5 /sound/soc/samsung | |
parent | 07961ac7c0ee8b546658717034fe692fd12eefa9 (diff) | |
download | linux-stable-a9b977ecd3dbc5d4f0fe0b3d5c66d284859b1f2a.tar.gz linux-stable-a9b977ecd3dbc5d4f0fe0b3d5c66d284859b1f2a.tar.bz2 linux-stable-a9b977ecd3dbc5d4f0fe0b3d5c66d284859b1f2a.zip |
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 <prathyush.k@samsung.com>
Signed-off-by: Padmavathi Venna <padma.v@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/samsung')
-rw-r--r-- | sound/soc/samsung/i2s.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index d7231e336a7c..f1fc06419560 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); |