Commit f62dc8f6 authored by Dongliang Mu's avatar Dongliang Mu Committed by Mauro Carvalho Chehab
Browse files

media: flexcop-usb: fix sanity check of bNumEndpoints

Commit d725d20e ("media: flexcop-usb: sanity checking of endpoint type
") adds a sanity check for endpoint[1], but fails to modify the sanity
check of bNumEndpoints.

Fix this by modifying the sanity check of bNumEndpoints to 2.

Link: https://lore.kernel.org/linux-media/20220602055027.849014-1-dzm91@hust.edu.cn


Fixes: d725d20e ("media: flexcop-usb: sanity checking of endpoint type")
Signed-off-by: default avatarDongliang Mu <mudongliangabcd@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 82fe45f3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -515,7 +515,7 @@ static int flexcop_usb_init(struct flexcop_usb *fc_usb)

	alt = fc_usb->uintf->cur_altsetting;

	if (alt->desc.bNumEndpoints < 1)
	if (alt->desc.bNumEndpoints < 2)
		return -ENODEV;
	if (!usb_endpoint_is_isoc_in(&alt->endpoint[0].desc))
		return -ENODEV;