Skip to content

Commit 9232fa0

Browse files
Michael Rieschmchehab
authored andcommitted
media: synopsys: csi2rx: fix out-of-bounds check for formats array
The out-of-bounds check for the format array is off by one. Fix the check. Fixes: 355a110 ("media: synopsys: add driver for the designware mipi csi-2 receiver") Cc: [email protected] Suggested-by: Dan Carpenter <[email protected]> Signed-off-by: Michael Riesch <[email protected]> Reviewed-by: Frank Li <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent f338e77 commit 9232fa0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/media/platform/synopsys/dw-mipi-csi2rx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ dw_mipi_csi2rx_enum_mbus_code(struct v4l2_subdev *sd,
301301

302302
return 0;
303303
case DW_MIPI_CSI2RX_PAD_SINK:
304-
if (code->index > csi2->formats_num)
304+
if (code->index >= csi2->formats_num)
305305
return -EINVAL;
306306

307307
code->code = csi2->formats[code->index].code;

0 commit comments

Comments
 (0)