Re: [PATCH v4] thunderbolt: fix bandwidth group reservation indexing
From: Mika Westerberg
Date: Thu Jun 25 2026 - 02:51:59 EST
On Wed, Jun 24, 2026 at 02:27:03PM +0800, raoxu wrote:
> From: Xu Rao <raoxu@xxxxxxxxxxxxx>
>
> Valid bandwidth group IDs range from 1 through MAX_GROUPS, while Group
> ID 0 is reserved. tb_consumed_dp_bandwidth() uses the Group ID directly
> to index its local group_reserved[] array.
>
> The array currently has MAX_GROUPS entries, so its valid indices are 0
> through MAX_GROUPS - 1. Group ID MAX_GROUPS therefore accesses one
> element past the end, and the final group's reserved bandwidth is not
> included when the array is summed.
>
> Give group_reserved[] MAX_GROUPS + 1 entries so direct Group ID
> indexing covers the reserved ID 0 and valid IDs 1 through MAX_GROUPS.
>
> Fixes: 52a4490e89d7 ("thunderbolt: Reserve released DisplayPort bandwidth for a group for 10 seconds")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Xu Rao <raoxu@xxxxxxxxxxxxx>
Applied to thunderbolt.git/fixes, thanks!