[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220920-invalid-desc-v1-1-76a93174f3bc@chromium.org>
Date: Tue, 20 Sep 2022 16:04:55 +0200
From: Ricardo Ribalda <ribalda@...omium.org>
To: Mauro Carvalho Chehab <mchehab@...nel.org>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>
Cc: linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
syzbot <syzkaller@...glegroups.com>,
Ricardo Ribalda <ribalda@...omium.org>
Subject: [PATCH v1 1/1] media: uvc: Handle cameras with invalid descriptors
If the source entity does not contain any pads, do not create a link.
Reported-by: syzbot <syzkaller@...glegroups.com>
Signed-off-by: Ricardo Ribalda <ribalda@...omium.org>
diff --git a/drivers/media/usb/uvc/uvc_entity.c b/drivers/media/usb/uvc/uvc_entity.c
index 7c4d2f93d351..1f730cb72e58 100644
--- a/drivers/media/usb/uvc/uvc_entity.c
+++ b/drivers/media/usb/uvc/uvc_entity.c
@@ -43,7 +43,7 @@ static int uvc_mc_create_links(struct uvc_video_chain *chain,
source = (UVC_ENTITY_TYPE(remote) == UVC_TT_STREAMING)
? (remote->vdev ? &remote->vdev->entity : NULL)
: &remote->subdev.entity;
- if (source == NULL)
+ if (source == NULL || source->num_pads == 0)
continue;
remote_pad = remote->num_pads - 1;
--
b4 0.11.0-dev-d93f8
Powered by blists - more mailing lists