summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/max9867.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2016-02-25 10:50:38 +0300
committerMark Brown <broonie@kernel.org>2016-02-26 10:34:51 +0900
commit90966391005e69a8964350278917a87fe49adf0f (patch)
tree942e8e7d099c48e2466bc35fb9a25b70d8a26602 /sound/soc/codecs/max9867.c
parent9dcc72efae313472d1d719e91b23e2bea3513789 (diff)
ASoC: max9867: silence and array overflow warning
Smatch complains that we might reach the end of this loop without finding what we're looking for leading to a buffer overflow. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/max9867.c')
-rwxr-xr-xsound/soc/codecs/max9867.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/codecs/max9867.c b/sound/soc/codecs/max9867.c
index f371a52fe29d..2a22fddeb6af 100755
--- a/sound/soc/codecs/max9867.c
+++ b/sound/soc/codecs/max9867.c
@@ -156,6 +156,8 @@ static inline int get_ni_value(int mclk, int rate)
if (ni_div[i].mclk >= mclk)
break;
}
+ if (i == ARRAY_SIZE(ni_div))
+ return -EINVAL;
switch (rate) {
case 8000: