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:
parent
c05b0c74a3
commit
e16217aa06
1 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue