Commit d7fd41c6 authored by Janusz Dziedzic's avatar Janusz Dziedzic Committed by Felipe Balbi

usb: dwc3: skip interrupt when ep disabled

In case EP disabled pass only EPCPLT command
to be handled. In other case we could hit
Bug like below.

BUG: unable to handle kernel NULL pointer dereference at 0000000000000003
IP:
[<ffffffff81673428>] dwc3_thread_interrupt+0x11c8/0x1790

while dep->endpoint.desc is NULL.
Signed-off-by: default avatarJanusz Dziedzic <januszx.dziedzic@linux.intel.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 0994b0a2
...@@ -2232,9 +2232,14 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc, ...@@ -2232,9 +2232,14 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc,
dep = dwc->eps[epnum]; dep = dwc->eps[epnum];
if (!(dep->flags & DWC3_EP_ENABLED) && if (!(dep->flags & DWC3_EP_ENABLED)) {
!(dep->flags & DWC3_EP_END_TRANSFER_PENDING)) if (!(dep->flags & DWC3_EP_END_TRANSFER_PENDING))
return; return;
/* Handle only EPCMDCMPLT when EP disabled */
if (event->endpoint_event != DWC3_DEPEVT_EPCMDCMPLT)
return;
}
if (epnum == 0 || epnum == 1) { if (epnum == 0 || epnum == 1) {
dwc3_ep0_interrupt(dwc, event); dwc3_ep0_interrupt(dwc, event);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment