From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933642Ab3JOFgS (ORCPT ); Tue, 15 Oct 2013 01:36:18 -0400 Received: from terminus.zytor.com ([198.137.202.10]:33969 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932603Ab3JOFgP (ORCPT ); Tue, 15 Oct 2013 01:36:15 -0400 Date: Mon, 14 Oct 2013 22:35:50 -0700 From: tip-bot for Chenggang Qin Message-ID: Cc: acme@redhat.com, mingo@redhat.com, mingo@kernel.org, a.p.zijlstra@chello.nl, efault@gmx.de, akpm@linux-foundation.org, yanmin.zhang@intel.com, dsahern@gmail.com, tglx@linutronix.de, fengguang.wu@intel.com, hpa@zytor.com, paulus@samba.org, linux-kernel@vger.kernel.org, arjan@linux.intel.com, namhyung@kernel.org, namhyung@gmail.com, chenggang.qcg@taobao.com Reply-To: mingo@kernel.org, mingo@redhat.com, acme@redhat.com, a.p.zijlstra@chello.nl, efault@gmx.de, akpm@linux-foundation.org, yanmin.zhang@intel.com, dsahern@gmail.com, tglx@linutronix.de, fengguang.wu@intel.com, hpa@zytor.com, paulus@samba.org, linux-kernel@vger.kernel.org, arjan@linux.intel.com, namhyung@kernel.org, namhyung@gmail.com, chenggang.qcg@taobao.com In-Reply-To: <1381451279-4109-3-git-send-email-chenggang.qin@gmail.com> References: <1381451279-4109-3-git-send-email-chenggang.qin@gmail.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf symbols: Fix a memory leak due to symbol__delete not being used Git-Commit-ID: d4f74eb89199dc7bde5579783e9188841e1271e3 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 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.1 (terminus.zytor.com [127.0.0.1]); Mon, 14 Oct 2013 22:35:56 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: d4f74eb89199dc7bde5579783e9188841e1271e3 Gitweb: http://git.kernel.org/tip/d4f74eb89199dc7bde5579783e9188841e1271e3 Author: Chenggang Qin AuthorDate: Fri, 11 Oct 2013 08:27:59 +0800 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 14 Oct 2013 12:21:20 -0300 perf symbols: Fix a memory leak due to symbol__delete not being used In function symbols__fixup_duplicate(), while duplicated symbols are found, only the rb_node is removed from the tree. The symbol structures themself are ignored. Then, these memory areas are lost. Signed-off-by: Chenggang Qin Acked-by: Namhyung Kim Cc: Andrew Morton Cc: Arjan van de Ven Cc: David Ahern Cc: Ingo Molnar Cc: Mike Galbraith Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Wu Fengguang Cc: Yanmin Zhang Link: http://lkml.kernel.org/r/1381451279-4109-3-git-send-email-chenggang.qin@gmail.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/symbol.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index b66c1ee..c0c3696 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -160,10 +160,12 @@ again: if (choose_best_symbol(curr, next) == SYMBOL_A) { rb_erase(&next->rb_node, symbols); + symbol__delete(next); goto again; } else { nd = rb_next(&curr->rb_node); rb_erase(&curr->rb_node, symbols); + symbol__delete(curr); } } }