From: Arnaldo Carvalho de Melo Date: Mon, 10 Aug 2015 18:45:55 +0000 (-0300) Subject: perf hists: hist_entry__cmp() may use he_tmp.hists, initialize it X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5cef897652f224442c013d9e9425536b38385351;p=linux-beck.git perf hists: hist_entry__cmp() may use he_tmp.hists, initialize it The iter_add_next_cumulative_entry() function calls hist_entry__cmp(), which may want to access the hists where this hist_entry is stored, initialize it to let that happen and avoid segfaults. Cc: Adrian Hunter Cc: Borislav Petkov Cc: David Ahern Cc: Frederic Weisbecker Cc: Jiri Olsa Cc: Namhyung Kim Cc: Stephane Eranian Link: http://lkml.kernel.org/n/tip-iqg98sfn4fvwcxp0pdvqauie@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index a6e9ddd37913..2fe6ea39e257 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -761,6 +761,7 @@ iter_add_next_cumulative_entry(struct hist_entry_iter *iter, struct hist_entry **he_cache = iter->priv; struct hist_entry *he; struct hist_entry he_tmp = { + .hists = evsel__hists(evsel), .cpu = al->cpu, .thread = al->thread, .comm = thread__comm(al->thread),