Re: [PATCH] ASoC: cache: Do the codec->reg_cache zero pionter check

2014-03-03 Thread Mark Brown
On Fri, Feb 28, 2014 at 10:48:19AM +0800, Xiubo Li wrote: > For the snd_soc_cache_init(), the reg_size maybe zero and then the value > of codec->reg_cache, which is alloced via kzalloc, maybe equal to > ZERO_SIZE_PTR. If the reg parameter of snd_soc_cache_write() is large enough, > the cache[idx] =

Re: [alsa-devel] [PATCH] ASoC: cache: Do the codec->reg_cache zero pionter check

2014-02-27 Thread Lars-Peter Clausen
On 02/28/2014 03:48 AM, Xiubo Li wrote: For the snd_soc_cache_init(), the reg_size maybe zero and then the value of codec->reg_cache, which is alloced via kzalloc, maybe equal to ZERO_SIZE_PTR. If the reg parameter of snd_soc_cache_write() is large enough, the cache[idx] = val maybe cause the ker

[PATCH] ASoC: cache: Do the codec->reg_cache zero pionter check

2014-02-27 Thread Xiubo Li
For the snd_soc_cache_init(), the reg_size maybe zero and then the value of codec->reg_cache, which is alloced via kzalloc, maybe equal to ZERO_SIZE_PTR. If the reg parameter of snd_soc_cache_write() is large enough, the cache[idx] = val maybe cause the kernel crash... So this patch fix this via d