public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Mathieu Poirier <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: peterz@infradead.org, linux-kernel@vger.kernel.org,
	alexander.shishkin@linux.intel.com, tglx@linutronix.de,
	hpa@zytor.com, acme@redhat.com, yao.jin@linux.intel.com,
	mathieu.poirier@linaro.org, namhyung@kernel.org,
	mingo@kernel.org
Subject: [tip:perf/core] perf cs-etm: Freeing allocated memory
Date: Sat, 17 Feb 2018 03:28:56 -0800	[thread overview]
Message-ID: <tip-099c1130998fd2234a200b55d69713ec66d88325@git.kernel.org> (raw)
In-Reply-To: <1518467557-18505-2-git-send-email-mathieu.poirier@linaro.org>

Commit-ID:  099c1130998fd2234a200b55d69713ec66d88325
Gitweb:     https://git.kernel.org/tip/099c1130998fd2234a200b55d69713ec66d88325
Author:     Mathieu Poirier <mathieu.poirier@linaro.org>
AuthorDate: Mon, 12 Feb 2018 13:32:35 -0700
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 16 Feb 2018 14:55:39 -0300

perf cs-etm: Freeing allocated memory

This patch frees all the memory allocated in function
cs_etm__alloc_queue().

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/1518467557-18505-2-git-send-email-mathieu.poirier@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/cs-etm.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
index b9f0a53..f2c9877 100644
--- a/tools/perf/util/cs-etm.c
+++ b/tools/perf/util/cs-etm.c
@@ -174,6 +174,12 @@ static void cs_etm__free_queue(void *priv)
 {
 	struct cs_etm_queue *etmq = priv;
 
+	if (!etmq)
+		return;
+
+	thread__zput(etmq->thread);
+	cs_etm_decoder__free(etmq->decoder);
+	zfree(&etmq->event_buf);
 	free(etmq);
 }
 

  reply	other threads:[~2018-02-17 11:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-12 20:32 [PATCH 0/3] perf tools: Miscellaneous fix from the previous cycle Mathieu Poirier
2018-02-12 20:32 ` [PATCH 1/3] perf tools: Freeing allocated memory Mathieu Poirier
2018-02-17 11:28   ` tip-bot for Mathieu Poirier [this message]
2018-02-12 20:32 ` [PATCH 2/3] perf util: Use target->per_thread and target->system_wide flags Mathieu Poirier
2018-02-17 11:29   ` [tip:perf/core] perf tools: " tip-bot for Jin Yao
2018-02-12 20:32 ` [PATCH 3/3] perf tools: Fixing uninitialised variable Mathieu Poirier
2018-02-17 11:29   ` [tip:perf/core] perf auxtrace arm: " tip-bot for Mathieu Poirier
2018-02-15 14:55 ` [PATCH 0/3] perf tools: Miscellaneous fix from the previous cycle Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-099c1130998fd2234a200b55d69713ec66d88325@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=acme@redhat.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=yao.jin@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox