Skip to content

Commit 6e893ca

Browse files
committed
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 <[email protected]>
1 parent 07aac5d commit 6e893ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/media/platform/qcom/camss-8x16/camss-vfe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,7 @@ static int vfe_reserve_wm(struct vfe_device *vfe, enum vfe_line_id line_id)
11301130

11311131
static int vfe_release_wm(struct vfe_device *vfe, u8 wm)
11321132
{
1133-
if (wm > ARRAY_SIZE(vfe->wm_output_map))
1133+
if (wm >= ARRAY_SIZE(vfe->wm_output_map))
11341134
return -EINVAL;
11351135

11361136
vfe->wm_output_map[wm] = VFE_LINE_NONE;

0 commit comments

Comments
 (0)