Skip to contentSkip to conversation

ASoC: Check for NULL register bank in snd_soc_get_cache_val()

PATCH In review Mark Brown 2 participants 2 messages Jun 6, 2011

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 ASoC: Check for NULL register bank in snd_soc_get_cache_val()

---
 sound/soc/soc-cache.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
sound/soc/soc-cache.c +3 -0
index d82ab42..9a88a27 100644
@@ -463,6 +463,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;
Signature · 1 line
1.7.5.3
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Mark Brown
---
 sound/soc/soc-cache.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
sound/soc/soc-cache.c +0 -0
index d82ab42..9a88a27 100644

sound/soc/soc-cache.c static bool snd_soc_set_cache_val(void *base, unsigned int idx, · line 471

Quoted 9 lines
sound/soc/soc-cache.c +3 -0
@@ -463,6 +463,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;