]> git.itanic.dy.fi Git - linux-stable/commitdiff
usb: xhci-mtk: fix leakage of shared hcd when fail to set wakeup irq
authorChunfeng Yun <chunfeng.yun@mediatek.com>
Mon, 28 Nov 2022 06:33:37 +0000 (14:33 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:26:51 +0000 (13:26 +0100)
commit 03a88b0bafbe3f548729d970d8366f48718c9b19 upstream.

Can not set the @shared_hcd to NULL before decrease the usage count
by usb_put_hcd(), this will cause the shared hcd not released.

Fixes: 04284eb74e0c ("usb: xhci-mtk: add support runtime PM")
Cc: <stable@vger.kernel.org>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/20221128063337.18124-1-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-mtk.c

index 01705e559c4225d30f4df791c6dc1ecc41ddc856..c61fc19ef1154bd058f4b03800de1031464c0e1b 100644 (file)
@@ -639,7 +639,6 @@ static int xhci_mtk_probe(struct platform_device *pdev)
 
 dealloc_usb3_hcd:
        usb_remove_hcd(xhci->shared_hcd);
-       xhci->shared_hcd = NULL;
 
 dealloc_usb2_hcd:
        usb_remove_hcd(hcd);