Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: xhci-mtk: fix leakage of shared hcd when fail to set wakeup irq

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>

authored by

Chunfeng Yun and committed by
Greg Kroah-Hartman
03a88b0b 27ef1784

-1
-1
drivers/usb/host/xhci-mtk.c
··· 646 646 647 647 dealloc_usb3_hcd: 648 648 usb_remove_hcd(xhci->shared_hcd); 649 - xhci->shared_hcd = NULL; 650 649 651 650 put_usb3_hcd: 652 651 usb_put_hcd(xhci->shared_hcd);