diff options
author | Ricardo Ribalda <ribalda@chromium.org> | 2022-09-20 17:04:55 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-11 18:40:15 +0300 |
commit | d8aa2e1ae6426d7cbddf1735aed1a63ddf0e6909 (patch) | |
tree | bc6208fd4e8e5bfd75f9c63e5c9ed1e480480d3d /drivers | |
parent | 76752888edcc3d01dbdf8886bc65af6767803471 (diff) | |
download | linux-d8aa2e1ae6426d7cbddf1735aed1a63ddf0e6909.tar.xz |
media: uvcvideo: Handle cameras with invalid descriptors
[ Upstream commit 41ddb251c68ac75c101d3a50a68c4629c9055e4c ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/usb/uvc/uvc_entity.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/usb/uvc/uvc_entity.c b/drivers/media/usb/uvc/uvc_entity.c index ca3a9c2eec27..7c9895377118 100644 --- a/drivers/media/usb/uvc/uvc_entity.c +++ b/drivers/media/usb/uvc/uvc_entity.c @@ -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) |