mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 10:09:10 +02:00
perf sched: Fix thread reference leak in latency_switch_event
In latency_switch_event(), after acquiring thread references for
sched_out and sched_in via machine__findnew_thread(), the first
add_sched_out_event() failure path does 'return -1', bypassing the
out_put label that calls thread__put() on both references.
The second and third add_sched_out_event() failures correctly use
'goto out_put'. Fix the first one to match.
Fixes: b91fc39f4a ("perf machine: Protect the machine->threads with a rwlock")
Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Assisted-by: Claude:claude-opus-4.6
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
a5498ccf80
commit
66ea9de603
|
|
@ -1180,7 +1180,7 @@ static int latency_switch_event(struct perf_sched *sched,
|
|||
}
|
||||
}
|
||||
if (add_sched_out_event(out_events, prev_state, timestamp))
|
||||
return -1;
|
||||
goto out_put;
|
||||
|
||||
in_events = thread_atoms_search(&sched->atom_root, sched_in, &sched->cmp_pid);
|
||||
if (!in_events) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user