|
@@ -239,6 +239,16 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum,
|
|
|
if (ifp->desc.bNumEndpoints >= num_ep)
|
|
|
goto skip_to_next_endpoint_or_interface_descriptor;
|
|
|
|
|
|
+ /* Check for duplicate endpoint addresses */
|
|
|
+ for (i = 0; i < ifp->desc.bNumEndpoints; ++i) {
|
|
|
+ if (ifp->endpoint[i].desc.bEndpointAddress ==
|
|
|
+ d->bEndpointAddress) {
|
|
|
+ dev_warn(ddev, "config %d interface %d altsetting %d has a duplicate endpoint with address 0x%X, skipping\n",
|
|
|
+ cfgno, inum, asnum, d->bEndpointAddress);
|
|
|
+ goto skip_to_next_endpoint_or_interface_descriptor;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
endpoint = &ifp->endpoint[ifp->desc.bNumEndpoints];
|
|
|
++ifp->desc.bNumEndpoints;
|
|
|
|