diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2014-07-16 03:19:43 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-07-17 09:32:35 -0400 |
commit | 9608b84e4dd95341b88cad646b114811f5bccbba (patch) | |
tree | 71783eeda6ca0000f604328c5929644444c07323 | |
parent | 29ce36121e6738012aaf00d983d25260627f2b0d (diff) |
perf thread: Allow deletion of a thread with no map groups
It needs to be possible to call thread__delete() on a thread with no map
groups.
This is needed for a subsequent patch which deletes a thread on the
error path before map groups have been attached.
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1405495184-20441-2-git-send-email-adrian.hunter@intel.com
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/util/thread.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c index 7a32f447a8e7..b9c36ef42d2f 100644 --- a/tools/perf/util/thread.c +++ b/tools/perf/util/thread.c | |||
@@ -60,8 +60,10 @@ void thread__delete(struct thread *thread) | |||
60 | { | 60 | { |
61 | struct comm *comm, *tmp; | 61 | struct comm *comm, *tmp; |
62 | 62 | ||
63 | map_groups__put(thread->mg); | 63 | if (thread->mg) { |
64 | thread->mg = NULL; | 64 | map_groups__put(thread->mg); |
65 | thread->mg = NULL; | ||
66 | } | ||
65 | list_for_each_entry_safe(comm, tmp, &thread->comm_list, list) { | 67 | list_for_each_entry_safe(comm, tmp, &thread->comm_list, list) { |
66 | list_del(&comm->list); | 68 | list_del(&comm->list); |
67 | comm__free(comm); | 69 | comm__free(comm); |