提交 6e893ca2 编写于 作者: M Mauro Carvalho Chehab

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: NMauro Carvalho Chehab <mchehab@s-opensource.com>
上级 07aac5dc
...@@ -1130,7 +1130,7 @@ static int vfe_reserve_wm(struct vfe_device *vfe, enum vfe_line_id line_id) ...@@ -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) 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; return -EINVAL;
vfe->wm_output_map[wm] = VFE_LINE_NONE; vfe->wm_output_map[wm] = VFE_LINE_NONE;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册