Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f8ff3a5a authored by JP Abgrall's avatar JP Abgrall
Browse files

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
parent 545ab460
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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));