Revert "usb: xhci-mtk: Do not use xhci's virt_dev in drop_endpoint"
authorChunfeng Yun <chunfeng.yun@mediatek.com>
Fri, 20 Aug 2021 06:59:13 +0000 (14:59 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Aug 2021 11:34:05 +0000 (13:34 +0200)
commitf2a9797b4efe54c94cc5ceb82ce1a4fba8b70a51
tree85cfb84b4cef0503f3740b2d1232986f202731a2
parent76d55a633ab61e70cb56720830e7be3dec0842fe
Revert "usb: xhci-mtk: Do not use xhci's virt_dev in drop_endpoint"

I find the patch introduce some issues, e.g.
1. oops happens when xhci_gen_setup() failed, and hash is not init
   but try to destroy it;
2. memory leakage happens when fail to insert ep, need free sch_ep,
   or insert ep after insert int list;
3. memory leakage happens when fail to allocate sch_array, need destroy
   rhashtable;
4. it's better to check ep->hcpriv when drop ep;

so prefer to revert this patch, and resend it after the issues are fixed.

This reverts commit b8731209958a1dffccc2888121f4c0280c990550.

Cc: Ikjoon Jang <ikjn@chromium.org>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/20210820065913.64490-2-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-mtk-sch.c
drivers/usb/host/xhci-mtk.h