Skip to content
Permalink
Browse files

usb: usb_dc_dw: Check endpoint is valid

Fix harness test issues.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
  • Loading branch information...
finikorg authored and nashif committed Mar 27, 2019
1 parent 81fbf0f commit 582b44014cccc4afd0f604d55574adfb28f7692c
Showing with 5 additions and 0 deletions.
  1. +5 −0 drivers/usb/device/usb_dc_dw.c
@@ -990,6 +990,11 @@ int usb_dc_ep_disable(const u8_t ep)
{
u8_t ep_idx = USB_DW_EP_ADDR2IDX(ep);

if (!usb_dw_ctrl.attached || !usb_dw_ep_is_valid(ep)) {
LOG_ERR("Not attached / Invalid endpoint: EP 0x%x", ep);
return -EINVAL;
}

/* Disable EP interrupts */
if (USB_DW_EP_ADDR2DIR(ep) == USB_EP_DIR_OUT) {
USB_DW->daintmsk &= ~USB_DW_DAINT_OUT_EP_INT(ep_idx);

0 comments on commit 582b440

Please sign in to comment.
You can’t perform that action at this time.