diff options
author | Rui Miguel Silva <rui.silva@linaro.org> | 2019-02-22 13:17:10 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-03-19 20:43:52 +0300 |
commit | 5eaa30aedd7fc4e6a9f077b7ae5b42c9965d5b98 (patch) | |
tree | b2f6ee01dd0e274a08c685f0915616d619bf4e87 | |
parent | 1fc79c4bb19ba5068fc42d3a66655c3b175f9934 (diff) | |
download | linux-5eaa30aedd7fc4e6a9f077b7ae5b42c9965d5b98.tar.xz |
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>
-rw-r--r-- | drivers/staging/media/imx/imx7-media-csi.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c index 1ba62fcdcae8..18eb5d3ecf10 100644 --- a/drivers/staging/media/imx/imx7-media-csi.c +++ b/drivers/staging/media/imx/imx7-media-csi.c @@ -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) { |