summaryrefslogtreecommitdiff
path: root/src/common/tusb_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/tusb_common.h')
-rw-r--r--src/common/tusb_common.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/common/tusb_common.h b/src/common/tusb_common.h
index b53fa5c02..d74760608 100644
--- a/src/common/tusb_common.h
+++ b/src/common/tusb_common.h
@@ -388,10 +388,7 @@ TU_ATTR_ALWAYS_INLINE static inline uint8_t tu_desc_subtype(void const* desc) {
}
TU_ATTR_ALWAYS_INLINE static inline bool tu_desc_in_bounds(const uint8_t *p_desc, const uint8_t *desc_end) {
- if (p_desc >= desc_end) {
- return false;
- }
- return tu_desc_next(p_desc) <= desc_end;
+ return p_desc < desc_end && tu_desc_next(p_desc) <= desc_end;
}
// find descriptor that match byte1 (type)