[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-260d819e3abdbdaa2b88fb983d1314f1b263f9e2@git.kernel.org>
Date: Sat, 17 Jan 2015 02:11:08 -0800
From: tip-bot for Namhyung Kim <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: mingo@...nel.org, linux-kernel@...r.kernel.org, dsahern@...il.com,
acme@...hat.com, a.p.zijlstra@...llo.nl, hpa@...or.com,
namhyung@...nel.org, tglx@...utronix.de, jolsa@...hat.com,
jolsa@...nel.org
Subject: [tip:perf/urgent] perf machine: Fix __machine__findnew_thread()
error path
Commit-ID: 260d819e3abdbdaa2b88fb983d1314f1b263f9e2
Gitweb: http://git.kernel.org/tip/260d819e3abdbdaa2b88fb983d1314f1b263f9e2
Author: Namhyung Kim <namhyung@...nel.org>
AuthorDate: Fri, 9 Jan 2015 09:38:12 +0900
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Fri, 16 Jan 2015 17:49:28 -0300
perf machine: Fix __machine__findnew_thread() error path
When thread__init_map_groups() fails, a new thread should be removed
from the rbtree since it's gonna be freed. Also update last match cache
only if the function succeeded.
Reported-by: David Ahern <dsahern@...il.com>
Signed-off-by: Namhyung Kim <namhyung@...nel.org>
Acked-by: Jiri Olsa <jolsa@...nel.org>
Cc: David Ahern <dsahern@...il.com>
Cc: Ingo Molnar <mingo@...nel.org>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Link: http://lkml.kernel.org/r/1420763892-15535-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/machine.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 94de3e4..1bca3a9 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -389,7 +389,6 @@ static struct thread *__machine__findnew_thread(struct machine *machine,
if (th != NULL) {
rb_link_node(&th->rb_node, parent, p);
rb_insert_color(&th->rb_node, &machine->threads);
- machine->last_match = th;
/*
* We have to initialize map_groups separately
@@ -400,9 +399,12 @@ static struct thread *__machine__findnew_thread(struct machine *machine,
* leader and that would screwed the rb tree.
*/
if (thread__init_map_groups(th, machine)) {
+ rb_erase(&th->rb_node, &machine->threads);
thread__delete(th);
return NULL;
}
+
+ machine->last_match = th;
}
return th;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists