Commit 41ddb251 authored by Ricardo Ribalda's avatar Ricardo Ribalda Committed by Laurent Pinchart

media: uvcvideo: Handle cameras with invalid descriptors

If the source entity does not contain any pads, do not create a link.
Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
Signed-off-by: default avatarRicardo Ribalda <ribalda@chromium.org>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
parent 50459f10
...@@ -37,7 +37,7 @@ static int uvc_mc_create_links(struct uvc_video_chain *chain, ...@@ -37,7 +37,7 @@ static int uvc_mc_create_links(struct uvc_video_chain *chain,
continue; continue;
remote = uvc_entity_by_id(chain->dev, entity->baSourceID[i]); remote = uvc_entity_by_id(chain->dev, entity->baSourceID[i]);
if (remote == NULL) if (remote == NULL || remote->num_pads == 0)
return -EINVAL; return -EINVAL;
source = (UVC_ENTITY_TYPE(remote) == UVC_TT_STREAMING) source = (UVC_ENTITY_TYPE(remote) == UVC_TT_STREAMING)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment