This is a note to let you know that I've just added the patch titled thunderbolt: Bond lanes only when dual_link_port != NULL in alloc_dev_default() to the 5.13-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: thunderbolt-bond-lanes-only-when-dual_link_port-null.patch and it can be found in the queue-5.13 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 4202a2fe5825fba396b824839ef5fe45cdb815fb Author: Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx> Date: Mon Jun 7 13:37:46 2021 +0300 thunderbolt: Bond lanes only when dual_link_port != NULL in alloc_dev_default() [ Upstream commit a0d36fa1065901f939b04587a09c65303a64ac88 ] We should not dereference ->dual_link_port if it is NULL and lane bonding is requested. For this reason move lane bonding configuration happen inside the block where ->dual_link_port != NULL. Fixes: 54509f5005ca ("thunderbolt: Add KUnit tests for path walking") Reported-by: kernel test robot <lkp@xxxxxxxxx> Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> Reviewed-by: Yehezkel Bernat <YehezkelShB@xxxxxxxxx> Signed-off-by: Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/thunderbolt/test.c b/drivers/thunderbolt/test.c index 5ff5a03bc9ce..6e0a5391fcd7 100644 --- a/drivers/thunderbolt/test.c +++ b/drivers/thunderbolt/test.c @@ -260,14 +260,14 @@ static struct tb_switch *alloc_dev_default(struct kunit *test, if (port->dual_link_port && upstream_port->dual_link_port) { port->dual_link_port->remote = upstream_port->dual_link_port; upstream_port->dual_link_port->remote = port->dual_link_port; - } - if (bonded) { - /* Bonding is used */ - port->bonded = true; - port->dual_link_port->bonded = true; - upstream_port->bonded = true; - upstream_port->dual_link_port->bonded = true; + if (bonded) { + /* Bonding is used */ + port->bonded = true; + port->dual_link_port->bonded = true; + upstream_port->bonded = true; + upstream_port->dual_link_port->bonded = true; + } } return sw;