[PATCH] usb: libcomposite: prevent duplicate bEndpointAddress by usb_ep_autoconfig_ss.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



usb_ep_autoconfig_ss tries to use endpoint name or internal counters to generate
bEndpointAddress - this leads to duplicate addresses. Fix is simple -
use only internal counter and dont rely on ep naming scheme.

Signed-off-by: Wlodzimierz Lipert <wlodzimierz.lipert@xxxxxxxxx>
---
 drivers/usb/gadget/epautoconf.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index 1eb4fa2e623f..40adf09079ed 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -93,10 +93,7 @@ struct usb_ep *usb_ep_autoconfig_ss(
 
 	/* report address */
 	desc->bEndpointAddress &= USB_DIR_IN;
-	if (isdigit(ep->name[2])) {
-		u8 num = simple_strtoul(&ep->name[2], NULL, 10);
-		desc->bEndpointAddress |= num;
-	} else if (desc->bEndpointAddress & USB_DIR_IN) {
+	if (desc->bEndpointAddress & USB_DIR_IN) {
 		if (++gadget->in_epnum > 15)
 			return NULL;
 		desc->bEndpointAddress = USB_DIR_IN | gadget->in_epnum;
-- 
2.39.2




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux