media: staging/imx: fix two NULL vs IS_ERR() bugs

The imx_media_pipeline_pad() function return NULL pointers on error, it
never returns error pointers.

Fixes: 3ef46bc97c ("media: staging/imx: Improve pipeline searching")

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
Dan Carpenter 2019-05-31 10:20:49 -04:00 committed by Mauro Carvalho Chehab
parent 9f7406d6b5
commit c89b413438
2 changed files with 4 additions and 4 deletions

View File

@ -193,8 +193,8 @@ static int csi_get_upstream_endpoint(struct csi_priv *priv,
/* get source pad of entity directly upstream from src */
pad = imx_media_pipeline_pad(src, 0, 0, true);
if (IS_ERR(pad))
return PTR_ERR(pad);
if (!pad)
return -ENODEV;
sd = media_entity_to_v4l2_subdev(pad->entity);

View File

@ -439,8 +439,8 @@ static int imx7_csi_get_upstream_endpoint(struct imx7_csi *csi,
skip_video_mux:
/* get source pad of entity directly upstream from src */
pad = imx_media_pipeline_pad(src, 0, 0, true);
if (IS_ERR(pad))
return PTR_ERR(pad);
if (!pad)
return -ENODEV;
sd = media_entity_to_v4l2_subdev(pad->entity);