summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/device/usbd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/device/usbd.c b/src/device/usbd.c
index 70141a5bb..fc658f1c1 100644
--- a/src/device/usbd.c
+++ b/src/device/usbd.c
@@ -378,7 +378,7 @@ TU_ATTR_ALWAYS_INLINE static inline usbd_class_driver_t const * get_driver(uint8
driver = &_app_driver[drvid];
} else{
drvid -= _app_driver_count;
- if (drvid < BUILTIN_DRIVER_COUNT) {
+ if (BUILTIN_DRIVER_COUNT > 0 && drvid < BUILTIN_DRIVER_COUNT) {
driver = &_usbd_driver[drvid];
}
}