diff options
author | Benoit Goby <benoit@android.com> | 2011-11-28 18:01:03 -0800 |
---|---|---|
committer | Benoit Goby <benoit@android.com> | 2011-11-28 19:02:13 -0800 |
commit | 6a4a38525d60db7e915d559273d8c89db5a98edf (patch) | |
tree | 76e5898610f63f6b88c44d22798ed1338a2b5717 | |
parent | dbb18fb2c1519b7810018580ee5123f9be73f213 (diff) | |
download | kernel_samsung_tuna-6a4a38525d60db7e915d559273d8c89db5a98edf.zip kernel_samsung_tuna-6a4a38525d60db7e915d559273d8c89db5a98edf.tar.gz kernel_samsung_tuna-6a4a38525d60db7e915d559273d8c89db5a98edf.tar.bz2 |
usb: gadget: android: Reset next_string_id before enable
Reset next_string_id to 0 before enabling the gadget driver. Otherwise,
after a large number of enable/disable cycles, bind will fail
because we cannot allocate new string ids. String ids cannot be larger
than 254 per USB spec.
Change-Id: I44f5fece45008b7a0a18c025d4eb5ce842585c28
Signed-off-by: Benoit Goby <benoit@android.com>
-rw-r--r-- | drivers/usb/gadget/android.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/gadget/android.c b/drivers/usb/gadget/android.c index d109bfb..5d77899 100644 --- a/drivers/usb/gadget/android.c +++ b/drivers/usb/gadget/android.c @@ -823,6 +823,7 @@ static ssize_t enable_store(struct device *pdev, struct device_attribute *attr, sscanf(buff, "%d", &enabled); if (enabled && !dev->enabled) { + cdev->next_string_id = 0; /* update values in composite driver's copy of device descriptor */ cdev->desc.idVendor = device_desc.idVendor; cdev->desc.idProduct = device_desc.idProduct; |