Add checking for MAX_HUB_NB in a part of code that depend on MAX_HUB_NB

pull/5800/head
Abdelhak Bougouffa 2017-12-02 17:09:46 +01:00
parent fd06eb2534
commit 4bba4e59fc
1 changed files with 3 additions and 0 deletions

View File

@ -88,11 +88,14 @@ void USBHost::usb_process()
/* check that hub is connected to root port */
if (usb_msg->hub_parent) {
/* a hub device must be present */
#if MAX_HUB_NB
for (k = 0; k < MAX_HUB_NB; k++) {
if ((&hubs[k] == usb_msg->hub_parent) && (hub_in_use[k])) {
hub_unplugged=false;
}
}
#endif
} else {
hub_unplugged = false;
}