Skip to contentSkip to conversation

media: rkisp1: Fix unused value issue

PATCH Superseded Dheeraj Reddy Jonnalagadda 2 participants 2 messages Nov 19, 2024 – Nov 20, 2024

Subsystems (3)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 media: rkisp1: Fix unused value issue

This commit fixes an unused value issue detected by Coverity (CID 1519008). The error condition for the invalid MIPI CSI-2 is not properly handled as the break statement would only exit the switch block and not the entire loop. Fixed this by returning the error immediately after the switch block.

Fixes 7d4f126fde89 ("media: rkisp1: Make the internal CSI-2 receiver

optional")

---
 drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c +3 -0
index dd114ab77800..9ad5026ab10a 100644
@@ -228,6 +228,9 @@ static int rkisp1_subdev_notifier_register(struct rkisp1_device *rkisp1)
 			break;
 		}
 
+		if (ret)
+			break;
+
 		/* Parse the endpoint and validate the bus type. */
 		ret = v4l2_fwnode_endpoint_parse(ep, &vep);
 		if (ret) {
Signature · 1 line
2.34.1
Reviewed-by on v3 1/1
#1 lore raw

Hi Dheeraj

Quoted 10 lines · Dheeraj Reddy Jonnalagadda

This commit fixes an unused value issue detected by Coverity (CID 1519008). The error condition for the invalid MIPI CSI-2 is not properly handled as the break statement would only exit the switch block and not the entire loop. Fixed this by returning the error immediately after the switch block.

Fixes 7d4f126fde89 ("media: rkisp1: Make the internal CSI-2 receiver

optional")

(if you receive a tag on a previous version of the patch you should carry it forward to the next patch version ;)

Thanks
j

Quoted 22 lines
---
 drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c +3 -1
index dd114ab77800..9ad5026ab10a 100644
@@ -228,6 +228,9 @@ static int rkisp1_subdev_notifier_register(struct rkisp1_device *rkisp1)
 			break;
 		}
 
+		if (ret)
+			break;
+
 		/* Parse the endpoint and validate the bus type. */
 		ret = v4l2_fwnode_endpoint_parse(ep, &vep);
 		if (ret) {
--

2.34.1