Merge "usb: dwc3: Fix use after free crash from dwc3 interrupt handler"

This commit is contained in:
qctecmdr 2019-10-29 16:46:08 -07:00 • committed by Gerrit - the friendly Code Review server
commit 8e72a3e00e
2 changed files with 8 additions and 2 deletions

View file

@ -398,8 +398,10 @@ static void dwc3_free_event_buffers(struct dwc3 *dwc)
struct dwc3_event_buffer *evt;
evt = dwc->ev_buf;
if (evt)
if (evt) {
dwc3_free_one_event_buffer(dwc, evt);
dwc->ev_buf = NULL;
}
/* free GSI related event buffers */
dwc3_notify_event(dwc, DWC3_GSI_EVT_BUF_FREE, 0);

View file

@ -3661,12 +3661,16 @@ static irqreturn_t dwc3_thread_interrupt(int irq, void *_evt)
static irqreturn_t dwc3_check_event_buf(struct dwc3_event_buffer *evt)
{
struct dwc3 *dwc = evt->dwc;
struct dwc3 *dwc;
u32 amount;
u32 count;
u32 reg;
ktime_t start_time;
if (!evt)
return IRQ_NONE;
dwc = evt->dwc;
start_time = ktime_get();
dwc->irq_cnt++;