From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754400AbcBPHyz (ORCPT ); Tue, 16 Feb 2016 02:54:55 -0500 Received: from terminus.zytor.com ([198.137.202.10]:40672 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754167AbcBPHyx (ORCPT ); Tue, 16 Feb 2016 02:54:53 -0500 Date: Mon, 15 Feb 2016 23:54:35 -0800 From: tip-bot for Arnaldo Carvalho de Melo Message-ID: Cc: ast@kernel.org, hpa@zytor.com, wangnan0@huawei.com, masami.hiramatsu.pt@hitachi.com, lizefan@huawei.com, acme@redhat.com, namhyung@kernel.org, mingo@kernel.org, linux-kernel@vger.kernel.org, hekuang@huawei.com, jolsa@kernel.org, tglx@linutronix.de Reply-To: wangnan0@huawei.com, ast@kernel.org, hpa@zytor.com, masami.hiramatsu.pt@hitachi.com, lizefan@huawei.com, mingo@kernel.org, namhyung@kernel.org, acme@redhat.com, hekuang@huawei.com, linux-kernel@vger.kernel.org, jolsa@kernel.org, tglx@linutronix.de To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf tools: Use perf_event_terms__purge() for non-malloced terms Git-Commit-ID: 682dc24c2a0f13d5a16ac8f4303671eb8f11519f X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 682dc24c2a0f13d5a16ac8f4303671eb8f11519f Gitweb: http://git.kernel.org/tip/682dc24c2a0f13d5a16ac8f4303671eb8f11519f Author: Arnaldo Carvalho de Melo AuthorDate: Fri, 12 Feb 2016 16:48:00 -0300 Committer: Arnaldo Carvalho de Melo CommitDate: Fri, 12 Feb 2016 16:53:22 -0300 perf tools: Use perf_event_terms__purge() for non-malloced terms In these two cases, a 'perf test' entry and in the PMU code the list_head is on the stack, so we can't use perf_event__free_terms() (soon to be renamed to perf_event_terms__delete()), because it will free the list_head as well. Acked-by: Jiri Olsa Cc: Alexei Starovoitov Cc: He Kuang Cc: Masami Hiramatsu Cc: Namhyung Kim Cc: Wang Nan Cc: Zefan Li Cc: pi3orama@163.com Link: http://lkml.kernel.org/n/tip-i956ryjhz97gnnqe8iqe7m7s@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/tests/parse-events.c | 2 +- tools/perf/util/pmu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c index abe8849..6648274 100644 --- a/tools/perf/tests/parse-events.c +++ b/tools/perf/tests/parse-events.c @@ -1666,7 +1666,7 @@ static int test_term(struct terms_test *t) } ret = t->check(&terms); - parse_events__free_terms(&terms); + parse_events_terms__purge(&terms); return ret; } diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c index 41a9c87..cf59fba 100644 --- a/tools/perf/util/pmu.c +++ b/tools/perf/util/pmu.c @@ -354,7 +354,7 @@ static int pmu_alias_terms(struct perf_pmu_alias *alias, list_for_each_entry(term, &alias->terms, list) { ret = parse_events_term__clone(&cloned, term); if (ret) { - parse_events__free_terms(&list); + parse_events_terms__purge(&list); return ret; } list_add_tail(&cloned->list, &list);