summaryrefslogtreecommitdiff
path: root/common/usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/usb.c')
-rw-r--r--common/usb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/usb.c b/common/usb.c
index 1bb9438f2a..4136f8d776 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -925,7 +925,9 @@ int usb_hub_configure(struct usb_device *dev)
}
descriptor = (struct usb_hub_descriptor *)buffer;
- if (descriptor->bLength > USB_BUFSIZ) {
+ /* silence compiler warning if USB_BUFSIZ is > 256 [= sizeof(char)] */
+ i = descriptor->bLength;
+ if (i > USB_BUFSIZ) {
USB_HUB_PRINTF("usb_hub_configure: failed to get hub descriptor - too long: %d\N",
descriptor->bLength);
return -1;