diff mbox series

usb: gadget: tegra-xudc: Fix PM disable depth imbalance on error path

Message ID 20201112133533.1793971-1-zhangqilong3@huawei.com (mailing list archive)
State New, archived
Headers show
Series usb: gadget: tegra-xudc: Fix PM disable depth imbalance on error path | expand

Commit Message

Zhang Qilong Nov. 12, 2020, 1:35 p.m. UTC
The pm_runtime_enable will increase power disable depth. Imbalance
depth will resulted in enabling runtime PM of device fails later.
Thus a pairing decrement must be needed on the error handling path
to keep it balanced.

Fixes: 49db427232fe2 ("usb: gadget: Add UDC driver for tegra XUSB device mode controller")
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
---
 drivers/usb/gadget/udc/tegra-xudc.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/usb/gadget/udc/tegra-xudc.c b/drivers/usb/gadget/udc/tegra-xudc.c
index 580bef8eb4cb..ad205e178033 100644
--- a/drivers/usb/gadget/udc/tegra-xudc.c
+++ b/drivers/usb/gadget/udc/tegra-xudc.c
@@ -3861,6 +3861,7 @@  static int tegra_xudc_probe(struct platform_device *pdev)
 	return 0;
 
 free_eps:
+	pm_runtime_disable(&pdev->dev);
 	tegra_xudc_free_eps(xudc);
 free_event_ring:
 	tegra_xudc_free_event_ring(xudc);