Skip to content

Commit 4bba4e5

Browse files
committed
Add checking for MAX_HUB_NB in a part of code that depend on MAX_HUB_NB
1 parent fd06eb2 commit 4bba4e5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

features/unsupported/USBHost/USBHost/USBHost.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,14 @@ void USBHost::usb_process()
8888
/* check that hub is connected to root port */
8989
if (usb_msg->hub_parent) {
9090
/* a hub device must be present */
91+
#if MAX_HUB_NB
92+
9193
for (k = 0; k < MAX_HUB_NB; k++) {
9294
if ((&hubs[k] == usb_msg->hub_parent) && (hub_in_use[k])) {
9395
hub_unplugged=false;
9496
}
9597
}
98+
#endif
9699
} else {
97100
hub_unplugged = false;
98101
}

0 commit comments

Comments
 (0)