[alsa-devel] [PATCH] ASoC: CX20442: fix NULL pointer dereference

Dimitris Papastamos dp at opensource.wolfsonmicro.com
Tue Feb 1 13:07:50 CET 2011

On Tue, 2011-02-01 at 13:01 +0100, Janusz Krzysztofik wrote:
> 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.

This shouldn't happen with the latest ASoC as there is support for NULL
default caches.  In particular the following code should be taking care
of the NULL pointer dereference

if (codec_drv->reg_cache_default) {
	codec->reg_def_copy = kmemdup(...);
	if (!codec->reg_def_copy) {
		ret = -ENOMEM;
		goto fail;

If this is not what soc-core looks like for you please pull broonie's
latest development tree.


More information about the Alsa-devel mailing list