mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
perf kvm: Fix memory leak in process_sample_event()
machine__resolve() indirectly acquires a thread reference via machine__findnew_thread(). Release it, as suggested by the documentation of the former. Signed-off-by: Michalis Niarchos <michael.niarchos@gmail.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
This commit is contained in:
parent
16a12a54e9
commit
8564e01efb
|
|
@ -1153,13 +1153,16 @@ static int process_sample_event(const struct perf_tool *tool,
|
|||
pr_debug("problem processing %s (%u) event at offset %#" PRIx64 ", skipping it.\n",
|
||||
perf_event__name(event->header.type), event->header.type,
|
||||
sample->file_offset);
|
||||
return -1;
|
||||
err = -1;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!handle_kvm_event(kvm, thread, sample))
|
||||
err = -1;
|
||||
|
||||
thread__put(thread);
|
||||
out:
|
||||
addr_location__exit(&kvm->al);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user