Skip to contentSkip to conversation

media: synopsys: csi2rx: various fixes

PATCH In review Michael Riesch 2 participants 5 messages Feb 16 – Feb 17

Subsystems (2)
lore
Share & tools
lore

Michael Riesch

author maintainer
#0 lore raw

cover 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]>
author maintainer
#1 lore raw

PATCH 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.

Fixes 355a11004066 ("media: synopsys: add driver for the designware mipi csi-2 receiver")
---
 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
index 170346ae1a59..4d96171a650b 100644
@@ -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
Reviewed-by on v1 1/2
#2 lore raw

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")

---

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
index 170346ae1a59..4d96171a650b 100644
@@ -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

author maintainer
#3 lore raw

PATCH 2/2 media: synopsys: csi2rx: add missing kconfig dependency

In reply to Michael Riesch

Fix "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.

Fixes 355a11004066 ("media: synopsys: add driver for the designware mipi csi-2 receiver")
---
 drivers/media/platform/synopsys/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/media/platform/synopsys/Kconfig +1 -0
index e798ec00b189..bf2ac092fbb3 100644
@@ -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
Reviewed-by on v1 2/2
#4 lore raw

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 selecting GENERIC_PHY_MIPI_DPHY in the Kconfig entry.

Quoted 6 lines
Fixes 355a11004066 ("media: synopsys: add driver for the designware mipi csi-2 receiver")

---

Quoted 20 lines
 drivers/media/platform/synopsys/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/media/platform/synopsys/Kconfig +1 -1
index e798ec00b189..bf2ac092fbb3 100644
@@ -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