patch "thunderbolt: Check return value of tb_sw_read() in usb4_switch_op()" added to usb-linus
Subsystems (2)
This is a note to let you know that I've just added the patch titled
thunderbolt: Check return value of tb_sw_read() in usb4_switch_op()
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.
If you have any questions about this process, please let me know.
From c3bf9930921b33edb31909006607e478751a6f5e Mon Sep 17 00:00:00 2001
From: Mika Westerberg <[email protected]>
Date: Thu, 9 Apr 2020 10:18:10 +0300
Subject: thunderbolt: Check return value of tb_sw_read() in usb4_switch_op()
The function misses checking return value of tb_sw_read() before it accesses the value that was read. Fix this by checking the return value first.
--- drivers/thunderbolt/usb4.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/thunderbolt/usb4.c +3 -0
@@ -182,6 +182,9 @@ static int usb4_switch_op(struct tb_switch *sw, u16 opcode, u8 *status)return ret; ret =tb_sw_read (sw, &val,TB_CFG_SWITCH ,ROUTER_CS_26 ,1 ); +if (ret) +return ret; +if (val &ROUTER_CS_26_ONS )return -EOPNOTSUPP ;
Signature · 1 line
2.26.2