Linux-USB Archive on
 help / color / Atom feed
* [PATCH AUTOSEL 5.5 01/28] thunderbolt: Fix error code in tb_port_is_width_supported()
@ 2020-03-26 23:23 Sasha Levin
  0 siblings, 0 replies; only message in thread
From: Sasha Levin @ 2020-03-26 23:23 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Dan Carpenter, Mika Westerberg, Sasha Levin, linux-usb

From: Dan Carpenter <>

[ Upstream commit e9d0e7511fda92a6511904996dd0aa57b6d7687a ]

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 <>
Signed-off-by: Mika Westerberg <>
Signed-off-by: Sasha Levin <>
 drivers/thunderbolt/switch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index 43bfeb8866141..f0f77da6ca26d 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -848,7 +848,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) >>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-26 23:23 [PATCH AUTOSEL 5.5 01/28] thunderbolt: Fix error code in tb_port_is_width_supported() Sasha Levin

Linux-USB Archive on

Archives are clonable:
	git clone --mirror linux-usb/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-usb linux-usb/ \
	public-inbox-index linux-usb

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone