diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2016-02-25 10:50:38 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-02-26 10:34:51 +0900 |
commit | 90966391005e69a8964350278917a87fe49adf0f (patch) | |
tree | 942e8e7d099c48e2466bc35fb9a25b70d8a26602 /sound/soc/codecs | |
parent | 9dcc72efae313472d1d719e91b23e2bea3513789 (diff) | |
download | op-kernel-dev-90966391005e69a8964350278917a87fe49adf0f.zip op-kernel-dev-90966391005e69a8964350278917a87fe49adf0f.tar.gz |
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')
-rwxr-xr-x | sound/soc/codecs/max9867.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/codecs/max9867.c b/sound/soc/codecs/max9867.c index f371a52..2a22fdd 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: |