Skip to contentSkip to conversation

media: flexcop-usb: fix endpoint type check

PATCH Superseded Johan Hovold 1 participant 2 messages Jun 9, 2022 – Jul 11, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: flexcop-usb: fix endpoint type check

Commit d725d20e81c2 ("media: flexcop-usb: sanity checking of endpoint type") tried to add an endpoint type sanity check for the single isochronous endpoint but instead broke the driver by checking the wrong descriptor or random data beyond the last endpoint descriptor.

Make sure to check the right endpoint descriptor.

Fixes d725d20e81c2 ("media: flexcop-usb: sanity checking of endpoint type")
Cc Oliver Neukum <[email protected]>
---
 drivers/media/usb/b2c2/flexcop-usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/usb/b2c2/flexcop-usb.c +1 -1
index 7835bb0f32fc..e012b21c4fd7 100644
@@ -511,7 +511,7 @@ static int flexcop_usb_init(struct flexcop_usb *fc_usb)
 
 	if (fc_usb->uintf->cur_altsetting->desc.bNumEndpoints < 1)
 		return -ENODEV;
-	if (!usb_endpoint_is_isoc_in(&fc_usb->uintf->cur_altsetting->endpoint[1].desc))
+	if (!usb_endpoint_is_isoc_in(&fc_usb->uintf->cur_altsetting->endpoint[0].desc))
 		return -ENODEV;
 
 	switch (fc_usb->udev->speed) {
Signature · 1 line
2.35.1
#1 lore raw
Quoted 5 lines · Johan Hovold

Commit d725d20e81c2 ("media: flexcop-usb: sanity checking of endpoint type") tried to add an endpoint type sanity check for the single isochronous endpoint but instead broke the driver by checking the wrong descriptor or random data beyond the last endpoint descriptor.

Quoted 8 lines

Make sure to check the right endpoint descriptor.

Fixes d725d20e81c2 ("media: flexcop-usb: sanity checking of endpoint type")
Cc Oliver Neukum <[email protected]>

---

I haven't received any notification about this one being added to any tree and the status is still set to "NEW" in the patch tracker so sending a reminder.

Quoted 8 lines
 drivers/media/usb/b2c2/flexcop-usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/usb/b2c2/flexcop-usb.c +0 -0
index 7835bb0f32fc..e012b21c4fd7 100644

drivers/media/usb/b2c2/flexcop-usb.c static int flexcop_usb_init(struct flexcop_usb *fc_usb) · line 517

Quoted 8 lines
drivers/media/usb/b2c2/flexcop-usb.c +1 -1
@@ -511,7 +511,7 @@ static int flexcop_usb_init(struct flexcop_usb *fc_usb)
 
 	if (fc_usb->uintf->cur_altsetting->desc.bNumEndpoints < 1)
 		return -ENODEV;
-	if (!usb_endpoint_is_isoc_in(&fc_usb->uintf->cur_altsetting->endpoint[1].desc))
+	if (!usb_endpoint_is_isoc_in(&fc_usb->uintf->cur_altsetting->endpoint[0].desc))
 		return -ENODEV;
 
 	switch (fc_usb->udev->speed) {

Johan