usb: dwc3: drd: Don't free non-existing irq
authorThinh Nguyen <Thinh.Nguyen@synopsys.com>
Mon, 30 Mar 2020 00:09:59 +0000 (17:09 -0700)
committerFelipe Balbi <balbi@kernel.org>
Tue, 5 May 2020 08:00:12 +0000 (11:00 +0300)
If the driver is configured to use DRD role-switch, it's not OTG. There
won't be OTG irq to free. Check for dwc->otg_irq before freeing it.

Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
drivers/usb/dwc3/drd.c

index 7db1ffc..a24c6c0 100644 (file)
@@ -653,6 +653,6 @@ void dwc3_drd_exit(struct dwc3 *dwc)
                break;
        }
 
-       if (!dwc->edev)
+       if (dwc->otg_irq)
                free_irq(dwc->otg_irq, dwc);
 }