Skip to content

Commit

Permalink
media: platform: sunxi: sun6i-csi: fix error return code of sun6i_vid…
Browse files Browse the repository at this point in the history
…eo_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.

Reported-by: TOTE Robot <[email protected]>
Signed-off-by: Jia-Ju Bai <[email protected]>
Fixes: 5cc7522 ("media: sun6i: Add support for Allwinner CSI V3s")
Acked-by: Chen-Yu Tsai <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
XidianGeneral authored and mchehab committed Mar 22, 2021
1 parent 41c991b commit f3d384e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f3d384e

Please sign in to comment.