projects
/
GitHub
/
LineageOS
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9dcc72e
)
ASoC: max9867: silence and array overflow warning
author
Dan Carpenter
<dan.carpenter@oracle.com>
Thu, 25 Feb 2016 07:50:38 +0000
(10:50 +0300)
committer
Mark Brown
<broonie@kernel.org>
Fri, 26 Feb 2016 01:34:51 +0000
(10:34 +0900)
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>
sound/soc/codecs/max9867.c
patch
|
blob
|
blame
|
history
diff --git
a/sound/soc/codecs/max9867.c
b/sound/soc/codecs/max9867.c
index f371a52fe29d6b9036d42cd45efa810ca953468e..2a22fddeb6afa02dbfb26b452cd4fd0f91b4024d 100755
(executable)
--- 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: