summaryrefslogtreecommitdiff
path: root/payloads/libpayload
diff options
context:
space:
mode:
Diffstat (limited to 'payloads/libpayload')
-rw-r--r--payloads/libpayload/drivers/usb/usb.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/payloads/libpayload/drivers/usb/usb.c b/payloads/libpayload/drivers/usb/usb.c
index bb42f89826..a6d5d43c23 100644
--- a/payloads/libpayload/drivers/usb/usb.c
+++ b/payloads/libpayload/drivers/usb/usb.c
@@ -173,10 +173,10 @@ get_descriptor(usbdev_t *dev, int rtype, int desc_type, int desc_idx,
ret = dev->controller->control(dev, IN,
sizeof(dr), &dr, len, data);
- if (ret)
- udelay(10);
- else
- return 0;
+
+ if (ret == len)
+ break;
+ udelay(10);
}
return ret;
}