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
This commit is contained in:
JP Abgrall 2012-04-18 15:30:56 -07:00
parent 545ab46063
commit f8ff3a5ae2

View file

@ -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));