Skip to content

Commit

Permalink
media: staging/imx: Fix NULL deref in find_pipeline_entity()
Browse files Browse the repository at this point in the history
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: 3ef46bc ("media: staging/imx: Improve pipeline searching")
Reported-by: Colin Ian King <[email protected]>
Signed-off-by: Steve Longerbeam <[email protected]>
Reviewed-by: Philipp Zabel <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
slongerbeam authored and mchehab committed Jul 23, 2019
1 parent 1a03f91 commit 02c25c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/media/imx/imx-media-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 02c25c0

Please sign in to comment.