Skip to content

Commit

Permalink
ASoC: Check for NULL register bank in snd_soc_get_cache_val()
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
  • Loading branch information
Mark Brown committed Jun 6, 2011
1 parent 6ac3406 commit fd137e2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sound/soc/soc-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fd137e2

Please sign in to comment.