Skip to content

Commit 3672613

Browse files
committed
subsys: usb: host: fix descriptor parsing by updating curr_addr
Move the pointer to the next descriptor to prevent incorrect address usage. Signed-off-by: Aiden Hu <[email protected]>
1 parent 72ebab0 commit 3672613

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

subsys/usb/host/usbh_desc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ struct usb_desc_header *usbh_desc_get_by_type(const uint8_t *const start_addr,
2323
if ((BIT(desc->bDescriptorType) & type_mask) != 0) {
2424
return desc;
2525
}
26+
curr_addr += desc->bLength;
2627
}
2728

2829
return NULL;

0 commit comments

Comments
 (0)