media: imx7-media-csi: don't store a floating pointer
if imx7_csi_try_fmt() fails, cc variable won't be initialized and csi->cc[sdformat->pad] would be pointing to a random location. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
Родитель
1fc79c4bb1
Коммит
5eaa30aedd
|
@ -1051,7 +1051,9 @@ static int imx7_csi_set_fmt(struct v4l2_subdev *sd,
|
|||
goto out_unlock;
|
||||
}
|
||||
|
||||
imx7_csi_try_fmt(csi, cfg, sdformat, &cc);
|
||||
ret = imx7_csi_try_fmt(csi, cfg, sdformat, &cc);
|
||||
if (ret < 0)
|
||||
goto out_unlock;
|
||||
|
||||
fmt = imx7_csi_get_format(csi, cfg, sdformat->pad, sdformat->which);
|
||||
if (!fmt) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче