diff mbox series

xhci: hisilicon: fix refercence leak in xhci_histb_probe

Message ID 20201030155012.100668-1-zhangqilong3@huawei.com (mailing list archive)
State Superseded
Headers show
Series xhci: hisilicon: fix refercence leak in xhci_histb_probe | expand

Commit Message

Zhang Qilong Oct. 30, 2020, 3:50 p.m. UTC
pm_runtime_get_sync() will increment pm usage counter.
Forgetting to call put operation in error path will
result in reference leak in xhci_histb_probe, so we
should fix it.

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
---
 drivers/usb/host/xhci-histb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/usb/host/xhci-histb.c b/drivers/usb/host/xhci-histb.c
index 5546e7e013a8..08369857686e 100644
--- a/drivers/usb/host/xhci-histb.c
+++ b/drivers/usb/host/xhci-histb.c
@@ -240,7 +240,7 @@  static int xhci_histb_probe(struct platform_device *pdev)
 	/* Initialize dma_mask and coherent_dma_mask to 32-bits */
 	ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32));
 	if (ret)
-		return ret;
+		goto disable_pm;
 
 	hcd = usb_create_hcd(driver, dev, dev_name(dev));
 	if (!hcd) {