summaryrefslogtreecommitdiffstats
path: root/drivers/thunderbolt
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2020-03-03 11:17:16 +0100
committerMika Westerberg <mika.westerberg@linux.intel.com>2020-03-04 10:34:17 +0100
commite9d0e7511fda92a6511904996dd0aa57b6d7687a (patch)
treed8a4df1acdd23867b839f9e7bf0953d39ac54a66 /drivers/thunderbolt
parentLinux 5.6-rc4 (diff)
downloadlinux-e9d0e7511fda92a6511904996dd0aa57b6d7687a.tar.xz
linux-e9d0e7511fda92a6511904996dd0aa57b6d7687a.zip
thunderbolt: Fix error code in tb_port_is_width_supported()
This function is type bool, and it's supposed to return true on success. Unfortunately, this path takes negative error codes and casts them to bool (true) so it's treated as success instead of failure. Fixes: 91c0c12080d0 ("thunderbolt: Add support for lane bonding") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt')
-rw-r--r--drivers/thunderbolt/switch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index 7d6ecc342508..a2ce99051c51 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -954,7 +954,7 @@ static bool tb_port_is_width_supported(struct tb_port *port, int width)
ret = tb_port_read(port, &phy, TB_CFG_PORT,
port->cap_phy + LANE_ADP_CS_0, 1);
if (ret)
- return ret;
+ return false;
widths = (phy & LANE_ADP_CS_0_SUPPORTED_WIDTH_MASK) >>
LANE_ADP_CS_0_SUPPORTED_WIDTH_SHIFT;