media: synopsys: csi2rx: various fixes
Michael Riesch
maintainercover media: synopsys: csi2rx: various fixes
Habidere,
This series contains two fixes that address two issues raised by CI bots.
1) A stupid off-by-one mistake in the check that protects the formats array. Thanks to Dan and his smatch bot.
2) A missing Kconfig dependency discovered by the lkp bot.
At this point, thanks to all the people that maintain those bots/the CI infrastructure!
Best regards,
Michael
---
Michael Riesch (2):
media: synopsys: csi2rx: fix out-of-bounds check for formats array
media: synopsys: csi2rx: add missing kconfig dependency
drivers/media/platform/synopsys/Kconfig | 1 + drivers/media/platform/synopsys/dw-mipi-csi2rx.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
---
base-commit: c824345288d11e269ce41b36c105715bc2286050
change-id: 20260216-snps-csi2rx-7b50a108ea3a
Best regards,
Signature · 1 line
Michael Riesch <[email protected]>
Michael Riesch
maintainerPATCH 1/2 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.
--- drivers/media/platform/synopsys/dw-mipi-csi2rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/synopsys/dw-mipi-csi2rx.c +1 -1
@@ -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;
Signature · 1 line
2.39.5
Re: [PATCH 1/2] media: synopsys: csi2rx: fix out-of-bounds check for formats array
Quoted 10 lines · On Mon, Feb 16, 2026 at 01:28:47PM +0100, Michael Riesch via B4 Relay wrote:
From: Michael Riesch <[email protected]>
The out-of-bounds check for the format array is off by one. Fix the check.
Fixes 355a11004066 ("media: synopsys: add driver for the designware mipi csi-2 receiver")Suggested-by Dan Carpenter <[email protected]>Signed-off-by Michael Riesch <[email protected]>---
Quoted 21 lines
drivers/media/platform/synopsys/dw-mipi-csi2rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/media/platform/synopsys/dw-mipi-csi2rx.c +1
-2@@ -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; --2.39.5
Michael Riesch
maintainerPATCH 2/2 media: synopsys: csi2rx: add missing kconfig dependency
In reply to Michael RieschFix "ERROR: modpost: "phy_mipi_dphy_get_default_config_for_hsclk" [drivers/media/platform/synopsys/dw-mipi-csi2rx.ko] undefined!" by selecting GENERIC_PHY_MIPI_DPHY in the Kconfig entry.
--- drivers/media/platform/synopsys/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/media/platform/synopsys/Kconfig +1 -0
@@ -7,6 +7,7 @@ config VIDEO_DW_MIPI_CSI2RX depends on VIDEO_DEV depends on V4L_PLATFORM_DRIVERS depends on PM && COMMON_CLK + select GENERIC_PHY_MIPI_DPHY select MEDIA_CONTROLLER select V4L2_FWNODE select VIDEO_V4L2_SUBDEV_API
Signature · 1 line
2.39.5
Re: [PATCH 2/2] media: synopsys: csi2rx: add missing kconfig dependencyy
Quoted 6 lines · On Mon, Feb 16, 2026 at 01:28:48PM +0100, Michael Riesch via B4 Relay wrote:
From: Michael Riesch <[email protected]>
Fix "ERROR: modpost: "
phy_mipi_dphy_get_default_config_for_hsclk" [drivers/media/platform/synopsys/dw-mipi-csi2rx.ko] undefined!" by selectingGENERIC_PHY_MIPI_DPHYin theKconfigentry.
Quoted 6 lines
Fixes 355a11004066 ("media: synopsys: add driver for the designware mipi csi-2 receiver")Reported-by kernel test robot <[email protected]>Signed-off-by Michael Riesch <[email protected]>---
Quoted 20 lines
drivers/media/platform/synopsys/Kconfig | 1 + 1 file changed, 1 insertion(+)drivers/media/platform/synopsys/Kconfig +1
-1@@ -7,6 +7,7 @@ config VIDEO_DW_MIPI_CSI2RX depends on VIDEO_DEV depends on V4L_PLATFORM_DRIVERS depends on PM && COMMON_CLK + select GENERIC_PHY_MIPI_DPHY select MEDIA_CONTROLLER select V4L2_FWNODE select VIDEO_V4L2_SUBDEV_API --2.39.5