Skip to content

Commit 08fe7ae

Browse files
Dan Carpenterwesteri
authored andcommitted
thunderbolt: Fix off by one in tb_port_find_retimer()
This array uses 1-based indexing so it corrupts memory one element beyond of the array. Fix it by making the array one element larger. Fixes: dacb128 ("thunderbolt: Add support for on-board retimers") Cc: [email protected] Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Mika Westerberg <[email protected]>
1 parent bec4d7c commit 08fe7ae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/thunderbolt/retimer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ static struct tb_retimer *tb_port_find_retimer(struct tb_port *port, u8 index)
406406
*/
407407
int tb_retimer_scan(struct tb_port *port)
408408
{
409-
u32 status[TB_MAX_RETIMER_INDEX] = {};
409+
u32 status[TB_MAX_RETIMER_INDEX + 1] = {};
410410
int ret, i, last_idx = 0;
411411

412412
if (!port->cap_usb4)

0 commit comments

Comments
 (0)