usb: dwc3: drd: Don't free non-existing irq

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>
This commit is contained in:
Thinh Nguyen
2020-05-05 11:00:12 +03:00
committed by Felipe Balbi
parent 31306821d8
commit 8cc6d55bc2
+1 -1
View 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);
}