Skip to content

Commit

Permalink
usb_dc_stm32: Fix check endpoint capabilities
Browse files Browse the repository at this point in the history
DT_USB_NUM_BIDIR_ENDPOINTS includes EP0, which we should not
take it into account when we check endpoint capabilities

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
  • Loading branch information
ydamigos authored and galak committed Feb 9, 2019
1 parent d942c1d commit 6a676ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/device/usb_dc_stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ int usb_dc_ep_check_cap(const struct usb_dc_ep_cfg_data * const cfg)
return -1;
}

if (ep_idx > DT_USB_NUM_BIDIR_ENDPOINTS) {
if (ep_idx > (DT_USB_NUM_BIDIR_ENDPOINTS - 1)) {
LOG_ERR("endpoint index/address out of range");
return -1;
}
Expand Down

0 comments on commit 6a676ca

Please sign in to comment.