[alsa-devel] [PATCH] ASoC: Check for NULL register bank in snd_soc_get_cache_val()

Liam Girdwood lrg at ti.com
Mon Jun 6 12:48:28 CEST 2011


On 06/06/11 11:26, Mark Brown wrote:
> Signed-off-by: Mark Brown <broonie at opensource.wolfsonmicro.com>
> ---
>  sound/soc/soc-cache.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c
> index d82ab42..9a88a27 100644
> --- a/sound/soc/soc-cache.c
> +++ b/sound/soc/soc-cache.c
> @@ -463,6 +463,9 @@ static bool snd_soc_set_cache_val(void *base, unsigned int idx,
>  static unsigned int snd_soc_get_cache_val(const void *base, unsigned int idx,
>  		unsigned int word_size)
>  {
> +	if (!base)
> +		return -1;
> +
>  	switch (word_size) {
>  	case 1: {
>  		const u8 *cache = base;

Acked-by: Liam Girdwood <lrg at ti.com>


More information about the Alsa-devel mailing list