From patchwork Mon Feb 15 21:01:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaldo Carvalho de Melo X-Patchwork-Id: 61963 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1290469lbl; Mon, 15 Feb 2016 13:02:14 -0800 (PST) X-Received: by 10.98.67.92 with SMTP id q89mr26275707pfa.137.1455570134220; Mon, 15 Feb 2016 13:02:14 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 10si45639027pfk.172.2016.02.15.13.02.13; Mon, 15 Feb 2016 13:02:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753756AbcBOVCM (ORCPT + 30 others); Mon, 15 Feb 2016 16:02:12 -0500 Received: from casper.infradead.org ([85.118.1.10]:38272 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753628AbcBOVCD (ORCPT ); Mon, 15 Feb 2016 16:02:03 -0500 Received: from [187.65.76.58] (helo=jouet.infradead.org) by casper.infradead.org with esmtpsa (Exim 4.85 #2 (Red Hat Linux)) id 1aVQHM-0006ph-RB; Mon, 15 Feb 2016 21:01:57 +0000 Received: by jouet.infradead.org (Postfix, from userid 1000) id 849F0143FF2; Mon, 15 Feb 2016 18:01:48 -0300 (BRT) From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, Wang Nan , Alexei Starovoitov , He Kuang , Masami Hiramatsu , Namhyung Kim , Zefan Li , pi3orama@163.com, Arnaldo Carvalho de Melo Subject: [PATCH 07/13] perf tools: Unlink entries from terms list Date: Mon, 15 Feb 2016 18:01:37 -0300 Message-Id: <1455570103-29211-8-git-send-email-acme@kernel.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1455570103-29211-1-git-send-email-acme@kernel.org> References: <1455570103-29211-1-git-send-email-acme@kernel.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wang Nan We were just freeing them, better unlink and init its nodes to catch bugs faster if we keep dangling references to them. Signed-off-by: Wang Nan Acked-by: Jiri Olsa Cc: Alexei Starovoitov Cc: He Kuang Cc: Masami Hiramatsu Cc: Namhyung Kim Cc: Zefan Li Cc: pi3orama@163.com [ Spun off from another patch, use list_del_init() instead of list_del() ] Link: http://lkml.kernel.org/r/1454680939-24963-2-git-send-email-wangnan0@huawei.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/parse-events.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.5.0 diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 813d9b272c81..133c8d28f36c 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -2072,8 +2072,10 @@ void parse_events__free_terms(struct list_head *terms) { struct parse_events_term *term, *h; - list_for_each_entry_safe(term, h, terms, list) + list_for_each_entry_safe(term, h, terms, list) { + list_del_init(&term->list); free(term); + } } void parse_events_evlist_error(struct parse_events_evlist *data,