mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 00:24:41 -04:00
Merge "usb: dwc3: Avoid NULL pointer access"
This commit is contained in:
commit
79600075fb
1 changed files with 8 additions and 1 deletions
|
|
@ -982,6 +982,9 @@ static struct dwc3_trb *dwc3_ep_prev_trb(struct dwc3_ep *dep, u8 index)
|
|||
{
|
||||
u8 tmp = index;
|
||||
|
||||
if (!dep->trb_pool)
|
||||
return NULL;
|
||||
|
||||
if (!tmp)
|
||||
tmp = DWC3_TRB_NUM - 1;
|
||||
|
||||
|
|
@ -1730,7 +1733,11 @@ int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value, int protocol)
|
|||
else
|
||||
trb = &dwc->ep0_trb[dep->trb_enqueue];
|
||||
|
||||
transfer_in_flight = trb->ctrl & DWC3_TRB_CTRL_HWO;
|
||||
if (trb)
|
||||
transfer_in_flight = trb->ctrl & DWC3_TRB_CTRL_HWO;
|
||||
else
|
||||
transfer_in_flight = false;
|
||||
|
||||
started = !list_empty(&dep->started_list);
|
||||
|
||||
if (!protocol && ((dep->direction && transfer_in_flight) ||
|
||||
|
|
|
|||
Loading…
Reference in a new issue