mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 04:34:03 +02:00
perf synthetic-events: Fix uninitialized pthread_join
In perf_event__synthesize_threads(), fix an uninitialized pthread_join()
call when thread creation fails by only joining the successfully
created threads.
Assisted-by: Antigravity:gemini-3.1-pro
Fixes: 340b47f510 ("perf top: Implement multithreading for perf_event__synthesize_threads")
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
This commit is contained in:
parent
38d778acbe
commit
54ba44db4d
|
|
@ -1221,8 +1221,8 @@ int perf_event__synthesize_threads(const struct perf_tool *tool,
|
|||
}
|
||||
err = 0;
|
||||
out_join:
|
||||
for (i = 0; i < thread_nr; i++)
|
||||
pthread_join(synthesize_threads[i], NULL);
|
||||
for (j = 0; j < i; j++)
|
||||
pthread_join(synthesize_threads[j], NULL);
|
||||
free(args);
|
||||
free_threads:
|
||||
free(synthesize_threads);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user