summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-06-06 11:26:15 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-06-06 19:34:11 +0100
commitfd137e2bba53b7207cbae6a1312e89ef3ae55624 (patch)
tree1ba6c2f7261c97e174dc59a33b9f9bffb25e4022 /sound
parent6ac340623c5d2a945030814d900701439772ff57 (diff)
downloadop-kernel-dev-fd137e2bba53b7207cbae6a1312e89ef3ae55624.zip
op-kernel-dev-fd137e2bba53b7207cbae6a1312e89ef3ae55624.tar.gz
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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c
index 06b7b81..c005ceb 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;
OpenPOWER on IntegriCloud