mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-26 00:12:56 -04:00
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: 355a110040 ("media: synopsys: add driver for the designware mipi csi-2 receiver")
Cc: stable@kernel.org
Suggested-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Michael Riesch <michael.riesch@collabora.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
f338e77383
commit
9232fa0592
@@ -301,7 +301,7 @@ dw_mipi_csi2rx_enum_mbus_code(struct v4l2_subdev *sd,
|
||||
|
||||
return 0;
|
||||
case DW_MIPI_CSI2RX_PAD_SINK:
|
||||
if (code->index > csi2->formats_num)
|
||||
if (code->index >= csi2->formats_num)
|
||||
return -EINVAL;
|
||||
|
||||
code->code = csi2->formats[code->index].code;
|
||||
|
||||
Reference in New Issue
Block a user