diff options
| author | JP Abgrall <jpa@google.com> | 2012-04-18 15:30:56 -0700 |
|---|---|---|
| committer | JP Abgrall <jpa@google.com> | 2012-04-18 15:31:23 -0700 |
| commit | f8ff3a5ae21ce34f22928709cc6f992ff2fdd56e (patch) | |
| tree | 991927028fba761d8327d96eac6a4d906eeb1dd2 /fastboot | |
| parent | 545ab46063f083239b29e59b8b491656d93f2a38 (diff) | |
| download | system_core-f8ff3a5ae21ce34f22928709cc6f992ff2fdd56e.zip system_core-f8ff3a5ae21ce34f22928709cc6f992ff2fdd56e.tar.gz system_core-f8ff3a5ae21ce34f22928709cc6f992ff2fdd56e.tar.bz2 | |
fastboot: Keep borked bootloaders happy by shrinking URB len.
Some devices will fail to return the requested data if the final
URB len of the request to > 255.
So shrink the current data buffer from 128 to 127 in the acse of getting
the serial number seems to work just fine.
Change-Id: Ic24e6c86ec93f002dc721d92309b3f880f281f20
Diffstat (limited to 'fastboot')
| -rw-r--r-- | fastboot/usb_linux.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fastboot/usb_linux.c b/fastboot/usb_linux.c index 85187de..83c6de9 100644 --- a/fastboot/usb_linux.c +++ b/fastboot/usb_linux.c @@ -131,7 +131,9 @@ static int filter_usb_device(int fd, char *ptr, int len, int writable, info.serial_number[0] = 0; if (dev->iSerialNumber) { struct usbdevfs_ctrltransfer ctrl; - __u16 buffer[128]; + // Keep it short enough because some bootloaders are borked if the URB len is > 255 + // 128 is too big by 1. + __u16 buffer[127]; int result; memset(buffer, 0, sizeof(buffer)); |
