aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorJanusz Krzysztofik <jkrzyszt@tis.icnet.pl>2011-02-01 07:01:17 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-02-01 09:13:56 -0500
commitf019ee5feb344ff0b22b58df4568676295aae14f (patch)
tree477fffe9007cdabc7052e46354166867fb18ccaf /sound
parentacd62276773b46810a3292af0c915c9782138ff2 (diff)
ASoC: CX20442: fix NULL pointer dereference
The CX20442 codec driver never provided the snd_soc_codec_driver's .reg_cache_default member. With the latest ASoC framework changes, it seems to be referred unconditionally, resulting in a NULL pointer dereference if missing. Provide it. Created and tested on Amstrad Delta against linux-2.6.38-rc2 Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/cx20442.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/codecs/cx20442.c b/sound/soc/codecs/cx20442.c
index 03d1e860d229..bb4bf65b9e7e 100644
--- a/sound/soc/codecs/cx20442.c
+++ b/sound/soc/codecs/cx20442.c
@@ -367,9 +367,12 @@ static int cx20442_codec_remove(struct snd_soc_codec *codec)
367 return 0; 367 return 0;
368} 368}
369 369
370static const u8 cx20442_reg = CX20442_TELOUT | CX20442_MIC;
371
370static struct snd_soc_codec_driver cx20442_codec_dev = { 372static struct snd_soc_codec_driver cx20442_codec_dev = {
371 .probe = cx20442_codec_probe, 373 .probe = cx20442_codec_probe,
372 .remove = cx20442_codec_remove, 374 .remove = cx20442_codec_remove,
375 .reg_cache_default = &cx20442_reg,
373 .reg_cache_size = 1, 376 .reg_cache_size = 1,
374 .reg_word_size = sizeof(u8), 377 .reg_word_size = sizeof(u8),
375 .read = cx20442_read_reg_cache, 378 .read = cx20442_read_reg_cache,