diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-06-06 11:26:15 +0100 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-06-06 19:34:11 +0100 |
commit | fd137e2bba53b7207cbae6a1312e89ef3ae55624 (patch) | |
tree | 1ba6c2f7261c97e174dc59a33b9f9bffb25e4022 /sound | |
parent | 6ac340623c5d2a945030814d900701439772ff57 (diff) | |
download | linux-3.10-fd137e2bba53b7207cbae6a1312e89ef3ae55624.tar.gz linux-3.10-fd137e2bba53b7207cbae6a1312e89ef3ae55624.tar.bz2 linux-3.10-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>
Diffstat (limited to 'sound')
-rw-r--r-- | 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 06b7b81a160..c005ceb70c9 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; |