drivers: usb_dc_sam: validate pointer in usb_dc_ep_is_stalled

Validate pointer argument in usb_dc_ep_is_stalled.

Fixes: #18824

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
This commit is contained in:
Johann Fischer 2019-09-02 13:27:57 +02:00 committed by Carles Cufí
commit e16217aa06

View file

@ -568,6 +568,10 @@ int usb_dc_ep_is_stalled(u8_t ep, u8_t *stalled)
return -EINVAL;
}
if (!stalled) {
return -EINVAL;
}
*stalled = (USBHS->USBHS_DEVEPTIMR[ep_idx] &
USBHS_DEVEPTIMR_STALLRQ) != 0;