Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Fixes: 5cc7522d8965 ("media: sun6i: Add support for Allwinner CSI V3s")
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

authored by

Jia-Ju Bai and committed by
Mauro Carvalho Chehab
f3d384e3 41c991bd

+3 -1
+3 -1
drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c
··· 151 151 } 152 152 153 153 subdev = sun6i_video_remote_subdev(video, NULL); 154 - if (!subdev) 154 + if (!subdev) { 155 + ret = -EINVAL; 155 156 goto stop_media_pipeline; 157 + } 156 158 157 159 config.pixelformat = video->fmt.fmt.pix.pixelformat; 158 160 config.code = video->mbus_code;