aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2014-06-02 16:08:21 +0100
committerMark Brown <broonie@linaro.org>2014-06-02 16:08:21 +0100
commitb5fc40d3b37bdb3524cdf1f550bd0c3b05ac3888 (patch)
treed922a107cac88df9b57b4e25b7f52d0b3e0f8109
parentASoC: cache: Fix possible ZERO_SIZE_PTR pointer dereferencing error. (diff)
downloadlinux-dev-b5fc40d3b37bdb3524cdf1f550bd0c3b05ac3888.tar.xz
linux-dev-b5fc40d3b37bdb3524cdf1f550bd0c3b05ac3888.zip
ASoC: cache: Fix error code when not using ASoC level cache
It is not an error to have no cache so we shouldn't return an error code and cause our callers to fail, just silently do nothing instead. Thanks to Jarkko for identify the problematic commit. Reported-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Reported-by: Fabio Estevam <festevam@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--sound/soc/soc-cache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c
index 8fff5b6d86db..00e70b6c7da2 100644
--- a/sound/soc/soc-cache.c
+++ b/sound/soc/soc-cache.c
@@ -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);