usb: usb_dc_native_posix: Check endpoint is valid

Fix harness tests.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This commit is contained in:
Andrei Emeltchenko 2019-03-27 11:34:02 +02:00 committed by Anas Nashif
commit 53ab1e2414

View file

@ -304,6 +304,11 @@ int usb_dc_ep_disable(const u8_t ep)
{
LOG_DBG("ep %x", ep);
if (!usbip_ctrl.attached || !usbip_ep_is_valid(ep)) {
LOG_ERR("Not attached / Invalid endpoint: EP 0x%x", ep);
return -EINVAL;
}
return 0;
}