]> git.baikalelectronics.ru Git - kernel.git/commit
usb: xhci-mtk: allow bandwidth table rollover
authorChunfeng Yun <chunfeng.yun@mediatek.com>
Fri, 27 Aug 2021 03:31:05 +0000 (11:31 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Aug 2021 08:24:51 +0000 (10:24 +0200)
commitfb37f4df600cdd08c04ea09eccf4f8c1877e3f87
treeb17de25ecdf47b56bc8d629f2e1760ed1a05badc
parent19d1e8e78c7741a04f2bfa37161e13aa0105c387
usb: xhci-mtk: allow bandwidth table rollover

xhci-mtk has 64 slots for periodic bandwidth calculations and each
slot represents byte budgets on a microframe. When an endpoint's
allocation sits on the boundary of the table, byte budgets' slot
can be rolled over but the current implementation doesn't.

This patch allows the microframe index rollover and prevent
out-of-bounds array access.

Signed-off-by: Ikjoon Jang <ikjn@chromium.org>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/20210827033105.26595-1-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