From fd137e2bba53b7207cbae6a1312e89ef3ae55624 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Mon, 6 Jun 2011 11:26:15 +0100 Subject: [PATCH] ASoC: Check for NULL register bank in snd_soc_get_cache_val() Signed-off-by: Mark Brown Acked-by: Liam Girdwood --- sound/soc/soc-cache.c | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.20.1