Skip to content

Commit

Permalink
[media] uvcvideo: Fix crash when linking entities
Browse files Browse the repository at this point in the history
The uvc_mc_register_entity() function wrongfully selects the
media_entity associated with a UVC entity when creating links. This
results in access to uninitialized media_entity structures and can hit a
BUG_ON statement in media_entity_create_link(). Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Laurent Pinchart authored and Mauro Carvalho Chehab committed Sep 22, 2011
1 parent 236c544 commit 4d9b2eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/video/uvc/uvc_entity.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static int uvc_mc_register_entity(struct uvc_video_chain *chain,
if (remote == NULL)
return -EINVAL;

source = (UVC_ENTITY_TYPE(remote) != UVC_TT_STREAMING)
source = (UVC_ENTITY_TYPE(remote) == UVC_TT_STREAMING)
? (remote->vdev ? &remote->vdev->entity : NULL)
: &remote->subdev.entity;
if (source == NULL)
Expand Down

0 comments on commit 4d9b2eb

Please sign in to comment.