The imx_media_pipeline_pad() function return NULL pointers on error, it never returns error pointers. Fixes: 3ef46bc97ca2 ("media: staging/imx: Improve pipeline searching") Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> --- drivers/staging/media/imx/imx-media-csi.c | 4 ++-- drivers/staging/media/imx/imx7-media-csi.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c index d2f880938af9..0eeb0db6d83f 100644 --- a/drivers/staging/media/imx/imx-media-csi.c +++ b/drivers/staging/media/imx/imx-media-csi.c @@ -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); diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c index b1af8694899e..882690561357 100644 --- a/drivers/staging/media/imx/imx7-media-csi.c +++ b/drivers/staging/media/imx/imx7-media-csi.c @@ -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); -- 2.20.1