Skip to contentSkip to conversation

media: platform: sunxi: sun6i-csi: fix error return code of sun6i_video_start_streaming()

PATCH In review Jia-Ju Bai 2 participants 3 messages Mar 6, 2021 – Mar 8, 2021

Subsystems (3)
lore
Share & tools
lore

Jia-Ju Bai

author
#0 lore raw

PATCH 1/1 media: platform: sunxi: sun6i-csi: fix error return code of sun6i_video_start_streaming()

When sun6i_video_remote_subdev() returns NULL to subdev, no error return code of sun6i_video_start_streaming() is assigned.
To fix this bug, ret is assigned with -EINVAL in this case.

---
 drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c +3 -1
index b55de9ab64d8..3181d0781b61 100644
@@ -151,8 +151,10 @@ static int sun6i_video_start_streaming(struct vb2_queue *vq, unsigned int count)
 	}
 
 	subdev = sun6i_video_remote_subdev(video, NULL);
-	if (!subdev)
+	if (!subdev) {
+		ret = -EINVAL;
 		goto stop_media_pipeline;
+	}
 
 	config.pixelformat = video->fmt.fmt.pix.pixelformat;
 	config.code = video->mbus_code;
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Jia-Ju Bai

When sun6i_video_remote_subdev() returns NULL to subdev, no error return code of sun6i_video_start_streaming() is assigned.
To fix this bug, ret is assigned with -EINVAL in this case.

This should have the tag:

Fixes 5cc7522d8965 ("media: sun6i: Add support for Allwinner CSI V3s")

Please try to add them when fixing bugs. And this should also be tagged for stable, so

Otherwise,

author
#2 lore raw
Quoted 11 lines · Chen-Yu Tsai
Quoted 6 lines · Jia-Ju Bai

When sun6i_video_remote_subdev() returns NULL to subdev, no error return code of sun6i_video_start_streaming() is assigned.
To fix this bug, ret is assigned with -EINVAL in this case.

This should have the tag:

Fixes 5cc7522d8965 ("media: sun6i: Add support for Allwinner CSI V3s")
Quoted 8 lines

Please try to add them when fixing bugs. And this should also be tagged for stable, so

Otherwise,

Thanks for the advice :)
I will add the fixes and stable tags in my future patches.

Best wishes,
Jia-Ju Bai