From f8ff3a5ae21ce34f22928709cc6f992ff2fdd56e Mon Sep 17 00:00:00 2001 From: JP Abgrall Date: Wed, 18 Apr 2012 15:30:56 -0700 Subject: [PATCH] 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 --- fastboot/usb_linux.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fastboot/usb_linux.c b/fastboot/usb_linux.c index 85187de22..83c6de908 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));