summaryrefslogtreecommitdiffstats
path: root/common/usb_hub.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/usb_hub.c')
-rw-r--r--common/usb_hub.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/usb_hub.c b/common/usb_hub.c
index 0f1eab4486..66b4a725d1 100644
--- a/common/usb_hub.c
+++ b/common/usb_hub.c
@@ -300,7 +300,8 @@ static int usb_hub_configure(struct usb_device *dev)
}
descriptor = (struct usb_hub_descriptor *)buffer;
- length = min(descriptor->bLength, sizeof(struct usb_hub_descriptor));
+ length = min_t(int, descriptor->bLength,
+ sizeof(struct usb_hub_descriptor));
if (usb_get_hub_descriptor(dev, buffer, length) < 0) {
debug("usb_hub_configure: failed to get hub " \
OpenPOWER on IntegriCloud