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

usb: xhci-mtk: break loop when find the endpoint to drop

No need to check the following endpoints after finding the endpoint
wanted to drop.

Fixes: 54f6a8af3722 ("usb: xhci-mtk: skip dropping bandwidth of unchecked endpoints")
Cc: stable <stable@vger.kernel.org>
Reported-by: Ikjoon Jang <ikjn@chromium.org>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/1612255104-5363-1-git-send-email-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Chunfeng Yun and committed by
Greg Kroah-Hartman
a50ea34d 54f6a8af

+3 -1
+3 -1
drivers/usb/host/xhci-mtk-sch.c
··· 689 689 sch_bw = &sch_array[bw_index]; 690 690 691 691 list_for_each_entry_safe(sch_ep, tmp, &sch_bw->bw_ep_list, endpoint) { 692 - if (sch_ep->ep == ep) 692 + if (sch_ep->ep == ep) { 693 693 destroy_sch_ep(udev, sch_bw, sch_ep); 694 + break; 695 + } 694 696 } 695 697 } 696 698 EXPORT_SYMBOL_GPL(xhci_mtk_drop_ep_quirk);