aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/media
diff options
context:
space:
mode:
authorSteve Longerbeam <slongerbeam@gmail.com>2019-06-26 14:52:25 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-07-23 11:42:39 -0400
commit02c25c003405776084d440c30041a33836b74710 (patch)
tree4a4597f5310bfb1acbce6a984a77b7861463f279 /drivers/staging/media
parentmedia: vivid: work around high stack usage with clang (diff)
downloadlinux-dev-02c25c003405776084d440c30041a33836b74710.tar.xz
linux-dev-02c25c003405776084d440c30041a33836b74710.zip
media: staging/imx: Fix NULL deref in find_pipeline_entity()
Fix a cut&paste error in find_pipeline_entity(). The start entity must be passed to media_entity_to_video_device() in find_pipeline_entity(), not pad->entity. The pad is only put to use later, after determining the start entity is not the entity being searched for. Fixes: 3ef46bc97ca2 ("media: staging/imx: Improve pipeline searching") Reported-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Steve Longerbeam <slongerbeam@gmail.com> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/staging/media')
-rw-r--r--drivers/staging/media/imx/imx-media-utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/media/imx/imx-media-utils.c b/drivers/staging/media/imx/imx-media-utils.c
index 9088c4b720a3..4cc6a7462ae2 100644
--- a/drivers/staging/media/imx/imx-media-utils.c
+++ b/drivers/staging/media/imx/imx-media-utils.c
@@ -841,7 +841,7 @@ find_pipeline_entity(struct media_entity *start, u32 grp_id,
if (sd->grp_id & grp_id)
return &sd->entity;
} else if (buftype && is_media_entity_v4l2_video_device(start)) {
- vfd = media_entity_to_video_device(pad->entity);
+ vfd = media_entity_to_video_device(start);
if (buftype == vfd->queue->type)
return &vfd->entity;
}