diff options
author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-08-26 22:34:37 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-08-26 22:34:37 +0300 |
commit | 6e893ca25e9ea87aeb5400af58518111e42582fe (patch) | |
tree | 0c5d5fb39e109e5c3077245070a9d8f047db26a7 /drivers/media/platform | |
parent | 07aac5dc0d1b9ccbf031ef3195bf11f65f732583 (diff) | |
download | linux-6e893ca25e9ea87aeb5400af58518111e42582fe.tar.xz |
media: qcom: don't go past the array
As reported by smatch:
drivers/media/platform/qcom/camss-8x16/camss-vfe.c:1136 vfe_release_wm() error: buffer overflow 'vfe->wm_output_map' 7 <= 7
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r-- | drivers/media/platform/qcom/camss-8x16/camss-vfe.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/platform/qcom/camss-8x16/camss-vfe.c b/drivers/media/platform/qcom/camss-8x16/camss-vfe.c index 94d635e00aa1..b21b3c2dc77f 100644 --- a/drivers/media/platform/qcom/camss-8x16/camss-vfe.c +++ b/drivers/media/platform/qcom/camss-8x16/camss-vfe.c @@ -1130,7 +1130,7 @@ static int vfe_reserve_wm(struct vfe_device *vfe, enum vfe_line_id line_id) static int vfe_release_wm(struct vfe_device *vfe, u8 wm) { - if (wm > ARRAY_SIZE(vfe->wm_output_map)) + if (wm >= ARRAY_SIZE(vfe->wm_output_map)) return -EINVAL; vfe->wm_output_map[wm] = VFE_LINE_NONE; |