thunderbolt: Bond lanes only when dual_link_port != NULL in alloc_dev_default()
authorMika Westerberg <mika.westerberg@linux.intel.com>
Mon, 7 Jun 2021 10:37:46 +0000 (13:37 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 14:56:44 +0000 (16:56 +0200)
commit2abfa5294717df154e345df77d58b794f8c9d5ba
treee0689c04fd5e5db68206dca4ce7853befb607b2c
parent36f60700f966627088a67c31c719a50c8e875315
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@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Yehezkel Bernat <YehezkelShB@gmail.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/thunderbolt/test.c