mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
perf tools: Use list_del_init() more thorougly
To allow for destructors to check if they're operating on a object still in a list, and to avoid going from use after free list entries into still valid, or even also other already removed from list entries. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: https://lkml.kernel.org/n/tip-deh17ub44atyox3j90e6rksu@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
d8f9da2404
commit
e56fbc9dc7
22 changed files with 38 additions and 38 deletions
|
@ -652,7 +652,7 @@ static int add_bpf_event(const char *group, const char *event, int fd,
|
|||
pr_debug("Failed to add BPF event %s:%s\n",
|
||||
group, event);
|
||||
list_for_each_entry_safe(evsel, tmp, &new_evsels, node) {
|
||||
list_del(&evsel->node);
|
||||
list_del_init(&evsel->node);
|
||||
perf_evsel__delete(evsel);
|
||||
}
|
||||
return err;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue