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)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Fri, 11 Jun 2021 08:42:54 +0000 (11:42 +0300)
commita0d36fa1065901f939b04587a09c65303a64ac88
tree71f56e2a42c62ca5ba3d34408a2139eec64092c3
parent25335b30daf66f4cc03715c2ac9cdc3258fb5531
thunderbolt: Bond lanes only when dual_link_port != NULL in alloc_dev_default()

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>
drivers/thunderbolt/test.c