summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-03-02 19:47:01 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-03-02 19:47:01 +0100
commit3c4a311c2c15ef0fa07c225ee02197a316e10e00 (patch)
treeb937bf8322b2f45afd92c6dd1cd39965d02276eb
parentLinux 6.8-rc6 (diff)
parentthunderbolt: Fix NULL pointer dereference in tb_port_update_credits() (diff)
downloadlinux-3c4a311c2c15ef0fa07c225ee02197a316e10e00.tar.xz
linux-3c4a311c2c15ef0fa07c225ee02197a316e10e00.zip
Merge tag 'thunderbolt-for-v6.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into usb-linus
Mika writes: thunderbolt: Fix for v6.8-rc7 This includes one USB4/Thunderbolt fix for v6.8-rc7: - Fix NULL pointer dereference in tb_port_update_credits() on Apple Thunderbolt 1 hardware. This has been in linux-next with no reported issues. * tag 'thunderbolt-for-v6.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt: thunderbolt: Fix NULL pointer dereference in tb_port_update_credits()
-rw-r--r--drivers/thunderbolt/switch.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index 900114ba4371..fad40c4bc710 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -1249,6 +1249,9 @@ int tb_port_update_credits(struct tb_port *port)
ret = tb_port_do_update_credits(port);
if (ret)
return ret;
+
+ if (!port->dual_link_port)
+ return 0;
return tb_port_do_update_credits(port->dual_link_port);
}