usb: usb_dc_kinetis: Fix endpoint index check

Fix check for maximum endpoint index.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This commit is contained in:
Andrei Emeltchenko 2019-03-27 09:40:42 +02:00 committed by Anas Nashif
commit 5b74fb4f23

View file

@ -281,7 +281,7 @@ int usb_dc_ep_check_cap(const struct usb_dc_ep_cfg_data * const cfg)
return -1; return -1;
} }
if (ep_idx > NUM_OF_EP_MAX) { if (ep_idx > (NUM_OF_EP_MAX - 1)) {
LOG_ERR("endpoint index/address out of range"); LOG_ERR("endpoint index/address out of range");
return -1; return -1;
} }