summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown2011-06-06 12:26:15 +0200
committerMark Brown2011-06-06 20:34:11 +0200
commitfd137e2bba53b7207cbae6a1312e89ef3ae55624 (patch)
tree1ba6c2f7261c97e174dc59a33b9f9bffb25e4022
parentASoC: Add missing break in WM8915 FLL source selection (diff)
downloadkernel-qcow2-linux-fd137e2bba53b7207cbae6a1312e89ef3ae55624.tar.gz
kernel-qcow2-linux-fd137e2bba53b7207cbae6a1312e89ef3ae55624.tar.xz
kernel-qcow2-linux-fd137e2bba53b7207cbae6a1312e89ef3ae55624.zip
ASoC: Check for NULL register bank in snd_soc_get_cache_val()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
-rw-r--r--sound/soc/soc-cache.c3
1 files changed, 3 insertions, 0 deletions
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;