diff options
-rw-r--r-- | drivers/usb/dwc2/hcd_intr.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/usb/dwc2/hcd_intr.c b/drivers/usb/dwc2/hcd_intr.c index c8da432e2fbc..07c9846ed011 100644 --- a/drivers/usb/dwc2/hcd_intr.c +++ b/drivers/usb/dwc2/hcd_intr.c @@ -2138,13 +2138,13 @@ irqreturn_t dwc2_handle_hcd_intr(struct dwc2_hsotg *hsotg) u32 gintsts, dbg_gintsts; irqreturn_t retval = IRQ_NONE; + spin_lock(&hsotg->lock); + if (!dwc2_is_controller_alive(hsotg)) { dev_warn(hsotg->dev, "Controller is dead\n"); - return retval; + goto out; } - spin_lock(&hsotg->lock); - /* Check if HOST Mode */ if (dwc2_is_host_mode(hsotg)) { gintsts = dwc2_read_core_intr(hsotg); @@ -2192,6 +2192,7 @@ irqreturn_t dwc2_handle_hcd_intr(struct dwc2_hsotg *hsotg) } } +out: spin_unlock(&hsotg->lock); return retval; |