From: Mark Brown Date: Wed, 10 Jul 2013 15:49:16 +0000 (+0100) Subject: ASoC: pcm3008: Check for platform data X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=33319a2fcc4482a97a8924e777bc0036d1d96696;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ASoC: pcm3008: Check for platform data The driver will crash if none is provided. Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/pcm3008.c b/sound/soc/codecs/pcm3008.c index 8ab1c03d26bd..4fa4ded30407 100644 --- a/sound/soc/codecs/pcm3008.c +++ b/sound/soc/codecs/pcm3008.c @@ -92,6 +92,9 @@ static int pcm3008_codec_probe(struct platform_device *pdev) struct pcm3008_setup_data *setup = pdev->dev.platform_data; int ret; + if (!setup) + return -EINVAL; + /* DEM1 DEM0 DE-EMPHASIS_MODE * Low Low De-emphasis 44.1 kHz ON * Low High De-emphasis OFF