fix urb and pipe pointer check order

This commit is contained in:
sakumisu
2022-09-12 20:42:06 +08:00
parent 1df32997ed
commit 2db0dc9a7e
2 changed files with 11 additions and 5 deletions

View File

@@ -754,9 +754,13 @@ int usbh_submit_urb(struct usbh_urb *urb)
size_t flags;
int ret = 0;
if (!urb) {
return -EINVAL;
}
chan = urb->pipe;
if (!urb || !chan) {
if (!chan) {
return -EINVAL;
}
@@ -832,7 +836,7 @@ int usbh_kill_urb(struct usbh_urb *urb)
pipe->urb = NULL;
usb_osal_leave_critical_section(flags);
return 0;
}