All of lore.kernel.org
 help / color / mirror / Atom feed
From: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
To: alsa-devel@alsa-project.org
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Liam Girdwood <lrg@slimlogic.co.uk>
Subject: [PATCH] ASoC: CX20442: fix NULL pointer dereference
Date: Tue, 1 Feb 2011 13:01:17 +0100	[thread overview]
Message-ID: <201102011301.17699.jkrzyszt@tis.icnet.pl> (raw)

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>
---
NOTE:
I'm not sure if the value choosen is Amstrad Delta specific or not.

 sound/soc/codecs/cx20442.c |    3 +++
 1 file changed, 3 insertions(+)

--- git/sound/soc/codecs/cx20442.c.orig	2011-01-31 20:09:18.000000000 +0100
+++ git/sound/soc/codecs/cx20442.c	2011-01-31 20:16:20.000000000 +0100
@@ -367,9 +367,12 @@ static int cx20442_codec_remove(struct s
 	return 0;
 }
 
+static const u8 cx20442_reg = CX20442_TELOUT | CX20442_MIC;
+
 static struct snd_soc_codec_driver cx20442_codec_dev = {
 	.probe = 	cx20442_codec_probe,
 	.remove = 	cx20442_codec_remove,
+	.reg_cache_default = &cx20442_reg,
 	.reg_cache_size = 1,
 	.reg_word_size = sizeof(u8),
 	.read = cx20442_read_reg_cache,

             reply	other threads:[~2011-02-01 12:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-01 12:01 Janusz Krzysztofik [this message]
2011-02-01 12:07 ` [PATCH] ASoC: CX20442: fix NULL pointer dereference Janusz Krzysztofik
2011-02-01 12:07 ` Dimitris Papastamos
2011-02-01 13:18   ` Janusz Krzysztofik
2011-02-01 13:19     ` Mark Brown
2011-02-01 14:30 ` Liam Girdwood
2011-02-01 14:31 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201102011301.17699.jkrzyszt@tis.icnet.pl \
    --to=jkrzyszt@tis.icnet.pl \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=lrg@slimlogic.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.