thunderbolt: Fix off by one in tb_port_find_retimer()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 29 Mar 2021 06:08:01 +0000 (09:08 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Apr 2021 06:42:03 +0000 (08:42 +0200)
commit126ce97d39cf2839454994aa29478259e453ef5f
tree6f313af1e96325254bd05f1a0d311316db1a95aa
parent256ece954961411c9dc77a08566cda47fabc8d71
thunderbolt: Fix off by one in tb_port_find_retimer()

commit 08fe7ae1857080f5075df5ac7fef2ecd4e289117 upstream.

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: dacb12877d92 ("thunderbolt: Add support for on-board retimers")
Cc: stable@vger.kernel.org
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/thunderbolt/retimer.c