From: Mark Brown Date: Mon, 6 Jun 2011 10:26:15 +0000 (+0100) Subject: ASoC: Check for NULL register bank in snd_soc_get_cache_val() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fd137e2bba53b7207cbae6a1312e89ef3ae55624;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ASoC: Check for NULL register bank in snd_soc_get_cache_val() Signed-off-by: Mark Brown Acked-by: Liam Girdwood --- diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c index 06b7b81a1601..c005ceb70c9d 100644 --- a/sound/soc/soc-cache.c +++ b/sound/soc/soc-cache.c @@ -466,6 +466,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;