Skip to contentSkip to conversation

ASoC: soc-cache: Fix the return value of snd_soc_cache_init when reg_size is 0

PATCH New Fabio Estevam 1 participant 1 message Jun 2, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ASoC: soc-cache: Fix the return value of snd_soc_cache_init when reg_size is 0

Commit b59dce53ef6 (ASoC: cache: Fix possible ZERO_SIZE_PTR pointer dereferencing error.) caused the following probe error:

wm8962 0-001a: customer id 0 revision D
wm8962 0-001a: ASoC: Failed to set cache compression type: -22 imx-wm8962 sound: snd_soc_register_card failed (-22)
imx-wm8962: probe of sound failed with error -22

If reg_size is 0 just return success instead.

---
Changes since v1:
- Fix typo "If reg_size is 0 just return success instead."

 sound/soc/soc-cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/soc-cache.c +1 -1
index 8fff5b6..00e70b6 100644
@@ -73,7 +73,7 @@ int snd_soc_cache_init(struct snd_soc_codec *codec)
 	reg_size = codec_drv->reg_cache_size * codec_drv->reg_word_size;
 
 	if (!reg_size)
-		return -EINVAL;
+		return 0;
 
 	mutex_init(&codec->cache_rw_mutex);
 
Signature · 1 line
1.8.3.2