Commit c89b4134 authored by Dan Carpenter's avatar Dan Carpenter Committed by Mauro Carvalho Chehab

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: 3ef46bc9 ("media: staging/imx: Improve pipeline searching")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 9f7406d6
...@@ -193,8 +193,8 @@ static int csi_get_upstream_endpoint(struct csi_priv *priv, ...@@ -193,8 +193,8 @@ static int csi_get_upstream_endpoint(struct csi_priv *priv,
/* get source pad of entity directly upstream from src */ /* get source pad of entity directly upstream from src */
pad = imx_media_pipeline_pad(src, 0, 0, true); pad = imx_media_pipeline_pad(src, 0, 0, true);
if (IS_ERR(pad)) if (!pad)
return PTR_ERR(pad); return -ENODEV;
sd = media_entity_to_v4l2_subdev(pad->entity); sd = media_entity_to_v4l2_subdev(pad->entity);
......
...@@ -439,8 +439,8 @@ static int imx7_csi_get_upstream_endpoint(struct imx7_csi *csi, ...@@ -439,8 +439,8 @@ static int imx7_csi_get_upstream_endpoint(struct imx7_csi *csi,
skip_video_mux: skip_video_mux:
/* get source pad of entity directly upstream from src */ /* get source pad of entity directly upstream from src */
pad = imx_media_pipeline_pad(src, 0, 0, true); pad = imx_media_pipeline_pad(src, 0, 0, true);
if (IS_ERR(pad)) if (!pad)
return PTR_ERR(pad); return -ENODEV;
sd = media_entity_to_v4l2_subdev(pad->entity); sd = media_entity_to_v4l2_subdev(pad->entity);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment