diff options
| author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-06-06 06:26:15 -0400 |
|---|---|---|
| committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-06-06 14:34:11 -0400 |
| commit | fd137e2bba53b7207cbae6a1312e89ef3ae55624 (patch) | |
| tree | 1ba6c2f7261c97e174dc59a33b9f9bffb25e4022 | |
| parent | 6ac340623c5d2a945030814d900701439772ff57 (diff) | |
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.c | 3 |
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, | |||
| 466 | static unsigned int snd_soc_get_cache_val(const void *base, unsigned int idx, | 466 | static unsigned int snd_soc_get_cache_val(const void *base, unsigned int idx, |
| 467 | unsigned int word_size) | 467 | unsigned int word_size) |
| 468 | { | 468 | { |
| 469 | if (!base) | ||
| 470 | return -1; | ||
| 471 | |||
| 469 | switch (word_size) { | 472 | switch (word_size) { |
| 470 | case 1: { | 473 | case 1: { |
| 471 | const u8 *cache = base; | 474 | const u8 *cache = base; |
