diff options
author | Mika Westerberg <mika.westerberg@linux.intel.com> | 2018-12-30 13:14:46 +0300 |
---|---|---|
committer | Mika Westerberg <mika.westerberg@linux.intel.com> | 2019-04-18 11:18:51 +0300 |
commit | f0342e757c271e7c6dd5adedfb6e6695c5af52bf (patch) | |
tree | beaa2c019b14a6f35e3f925a11c6ca78ad139df4 /drivers/thunderbolt/tb.h | |
parent | 09f11b6c99feaf86a26444bca85dc693b3f58f8b (diff) | |
download | linux-f0342e757c271e7c6dd5adedfb6e6695c5af52bf.tar.xz |
thunderbolt: Do not allocate switch if depth is greater than 6
Maximum depth in Thunderbolt topology is 6 so make sure it is not
possible to allocate switches that exceed the depth limit.
While at it update tb_switch_alloc() to use upper/lower_32_bits()
following tb_switch_alloc_safe_mode().
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt/tb.h')
-rw-r--r-- | drivers/thunderbolt/tb.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/thunderbolt/tb.h b/drivers/thunderbolt/tb.h index f7b0c43c29a7..93c1ea21feeb 100644 --- a/drivers/thunderbolt/tb.h +++ b/drivers/thunderbolt/tb.h @@ -43,6 +43,7 @@ struct tb_switch_nvm { }; #define TB_SWITCH_KEY_SIZE 32 +#define TB_SWITCH_MAX_DEPTH 6 /** * struct tb_switch - a thunderbolt switch |