Skip to contentSkip to conversation

media: atomisp: Add error check in create_host_regular_capture_pipeline()

PATCH Superseded Robertus Diawan Chris 2 participants 3 messages Apr 23 – Apr 24

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: atomisp: Add error check in create_host_regular_capture_pipeline()

When calling ia_css_pipeline_create_and_add_stage() function, there's no condition to check whether ia_css_pipeline_create_and_add_stage() throw an error or not. So add conditional check for the return value of ia_css_pipeline_create_and_add_stage() function.

This is reported by Coverity Scan with CID 1408952 as UNUSED_VALUE.

---
I am not sure if omitting the error check is intentional or not, but from what I see from another ia_css_pipeline_create_and_add_stage() usage in the same function, we check the return value after the call and return the error code if it's non-zero.

I also don't have the device to test this change.

 drivers/staging/media/atomisp/pci/sh_css.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/staging/media/atomisp/pci/sh_css.c +4 -0
index 6cda5925fa45..6aa8a883cc76 100644
@@ -7041,6 +7041,10 @@ create_host_regular_capture_pipeline(struct ia_css_pipe *pipe)
 			err = ia_css_pipeline_create_and_add_stage(me,
 								   &stage_desc,
 								   &current_stage);
+			if (err) {
+				IA_CSS_LEAVE_ERR_PRIVATE(err);
+				return err;
+			}
 			local_in_frame = current_stage->args.out_frame[0];
 		}
 		err = add_capture_pp_stage(pipe, me, local_in_frame,

base-commit: 2e68039281932e6dc37718a1ea7cbb8e2cda42e6

Signature · 1 line
2.53.0
#1 lore raw
Quoted 9 lines · Robertus Diawan Chris

When calling ia_css_pipeline_create_and_add_stage() function, there's no condition to check whether ia_css_pipeline_create_and_add_stage() throw an error or not. So add conditional check for the return value of ia_css_pipeline_create_and_add_stage() function.

This is reported by Coverity Scan with CID 1408952 as UNUSED_VALUE.

---

You need a Fixes tag.

regards,
dan carpenter

#2 lore raw

Hello Dan,

Quoted 6 lines · Dan Carpenter
Quoted 5 lines · Robertus Diawan Chris

When calling ia_css_pipeline_create_and_add_stage() function, there's no condition to check whether ia_css_pipeline_create_and_add_stage() throw an error or not. So add conditional check for the return value of ia_css_pipeline_create_and_add_stage() function.

Quoted 6 lines
Quoted 4 lines

This is reported by Coverity Scan with CID 1408952 as UNUSED_VALUE.

---

You need a Fixes tag.

Oh I didn't know that we need to add Fixes tag too. Alright, I will add Fixes tag in the next iteration of the patch.

Thank you for the feedback.

Best regards,
Robertus Diawan Chris