Skip to content

Commit 8b69536

Browse files
committed
Merge tag 'thunderbolt-for-v6.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into usb-linus
Mika writes: thunderbolt: Fix for v6.6-rc7 This includes a single commit that fixes a memory leak when DisplayPort bandwidth allocation request is being handled by the driver. This has been in linux-next with no reported issues. * tag 'thunderbolt-for-v6.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt: thunderbolt: Call tb_switch_put() once DisplayPort bandwidth request is finished
2 parents 5872080 + ec4405e commit 8b69536

File tree

1 file changed

+6
-4
lines changed
  • drivers/thunderbolt

1 file changed

+6
-4
lines changed

drivers/thunderbolt/tb.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1907,14 +1907,14 @@ static void tb_handle_dp_bandwidth_request(struct work_struct *work)
19071907
in = &sw->ports[ev->port];
19081908
if (!tb_port_is_dpin(in)) {
19091909
tb_port_warn(in, "bandwidth request to non-DP IN adapter\n");
1910-
goto unlock;
1910+
goto put_sw;
19111911
}
19121912

19131913
tb_port_dbg(in, "handling bandwidth allocation request\n");
19141914

19151915
if (!usb4_dp_port_bandwidth_mode_enabled(in)) {
19161916
tb_port_warn(in, "bandwidth allocation mode not enabled\n");
1917-
goto unlock;
1917+
goto put_sw;
19181918
}
19191919

19201920
ret = usb4_dp_port_requested_bandwidth(in);
@@ -1923,7 +1923,7 @@ static void tb_handle_dp_bandwidth_request(struct work_struct *work)
19231923
tb_port_dbg(in, "no bandwidth request active\n");
19241924
else
19251925
tb_port_warn(in, "failed to read requested bandwidth\n");
1926-
goto unlock;
1926+
goto put_sw;
19271927
}
19281928
requested_bw = ret;
19291929

@@ -1932,7 +1932,7 @@ static void tb_handle_dp_bandwidth_request(struct work_struct *work)
19321932
tunnel = tb_find_tunnel(tb, TB_TUNNEL_DP, in, NULL);
19331933
if (!tunnel) {
19341934
tb_port_warn(in, "failed to find tunnel\n");
1935-
goto unlock;
1935+
goto put_sw;
19361936
}
19371937

19381938
out = tunnel->dst_port;
@@ -1959,6 +1959,8 @@ static void tb_handle_dp_bandwidth_request(struct work_struct *work)
19591959
tb_recalc_estimated_bandwidth(tb);
19601960
}
19611961

1962+
put_sw:
1963+
tb_switch_put(sw);
19621964
unlock:
19631965
mutex_unlock(&tb->lock);
19641966

0 commit comments

Comments
 (0)