diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2019-05-31 10:20:49 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-06-03 10:46:45 -0400 |
commit | c89b41343862cabcbe3cc85c6c7b675cdd939a29 (patch) | |
tree | 52ce930572697245c9ed9444e561f3b498a80215 | |
parent | 9f7406d6b56b4b71a12480b68221755ea7b3e0ee (diff) | |
download | linux-c89b41343862cabcbe3cc85c6c7b675cdd939a29.tar.bz2 |
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: 3ef46bc97ca2 ("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>
-rw-r--r-- | drivers/staging/media/imx/imx-media-csi.c | 4 | ||||
-rw-r--r-- | 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); |