mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 01:10:04 +00:00
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
1 changed files with 1 additions and 1 deletions
|
@ -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 a new issue