Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);

+2 −2
Original line number Diff line number Diff line
@@ -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);