Skip to content

Commit e9d0e75

Browse files
Dan Carpenterwesteri
authored andcommitted
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: 91c0c12 ("thunderbolt: Add support for lane bonding") Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Mika Westerberg <[email protected]>
1 parent 98d54f8 commit e9d0e75

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/thunderbolt/switch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ static bool tb_port_is_width_supported(struct tb_port *port, int width)
954954
ret = tb_port_read(port, &phy, TB_CFG_PORT,
955955
port->cap_phy + LANE_ADP_CS_0, 1);
956956
if (ret)
957-
return ret;
957+
return false;
958958

959959
widths = (phy & LANE_ADP_CS_0_SUPPORTED_WIDTH_MASK) >>
960960
LANE_ADP_CS_0_SUPPORTED_WIDTH_SHIFT;

0 commit comments

Comments
 (0)