[PATCH] usb: cdc_ether: Ignore bogus union descriptor for RNDIS devices

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

 



Some RNDIS devices include a bogus CDC Union descriptor pointing
to non-existing interfaces.  The RNDIS code is already prepared
to handle devices without a CDC Union descriptor, so we can just
ignore it.

Cc: Markus Kolb <linux-201011@xxxxxxxxxxxx>
Cc: Iker Salmón San Millán <shaola@xxxxxxxxxxxx>
Cc: Jonathan Nieder <jrnieder@xxxxxxxxx>
Cc: Oliver Neukum <oliver@xxxxxxxxxxx>
Cc: 655387@xxxxxxxxxxxxxxx
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Bjørn Mork <bjorn@xxxxxxx>
---
How about this, which IMHO is less intrusive? Only build-tested, as I
don't have any of the failing devices, so it will obviously need 
testing from anyone with such a device.
 
 drivers/net/usb/cdc_ether.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
index 41a61ef..2109f34 100644
--- a/drivers/net/usb/cdc_ether.c
+++ b/drivers/net/usb/cdc_ether.c
@@ -195,7 +195,15 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
 					info->control,
 					info->u->bSlaveInterface0,
 					info->data);
-				goto bad_desc;
+				/* Fallback to guessing for rndis
+				 * class devices with bogus union
+				 * descriptor.
+				 * Fixes some Samsung Android devices
+				 */
+				if (rndis)
+					info->u = NULL;
+				else
+					goto bad_desc;
 			}
 			if (info->control != intf) {
 				dev_dbg(&intf->dev, "bogus CDC Union\n");
-- 
1.7.7.3

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

  Powered by Linux