media: uvcvideo: Handle cameras with invalid descriptors
If the source entity does not contain any pads, do not create a link. Reported-by: syzbot <syzkaller@googlegroups.com> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
50459f103e
commit
41ddb251c6
|
@ -37,7 +37,7 @@ static int uvc_mc_create_links(struct uvc_video_chain *chain,
|
|||
continue;
|
||||
|
||||
remote = uvc_entity_by_id(chain->dev, entity->baSourceID[i]);
|
||||
if (remote == NULL)
|
||||
if (remote == NULL || remote->num_pads == 0)
|
||||
return -EINVAL;
|
||||
|
||||
source = (UVC_ENTITY_TYPE(remote) == UVC_TT_STREAMING)
|
||||
|
|
Loading…
Reference in New Issue