From: Mathieu Poirier <mathieu.poirier@linaro.org> To: acme@kernel.org Cc: peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, namhyung@kernel.org, yao.jin@linux.intel.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] perf tools: Freeing allocated memory Date: Mon, 12 Feb 2018 13:32:35 -0700 [thread overview] Message-ID: <1518467557-18505-2-git-send-email-mathieu.poirier@linaro.org> (raw) In-Reply-To: <1518467557-18505-1-git-send-email-mathieu.poirier@linaro.org> This patch frees all the memory allocated in function cs_etm__alloc_queue(). Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> --- 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 b9f0a53dfa65..f2c98774e665 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); } -- 2.7.4
WARNING: multiple messages have this Message-ID (diff)
From: mathieu.poirier@linaro.org (Mathieu Poirier) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/3] perf tools: Freeing allocated memory Date: Mon, 12 Feb 2018 13:32:35 -0700 [thread overview] Message-ID: <1518467557-18505-2-git-send-email-mathieu.poirier@linaro.org> (raw) In-Reply-To: <1518467557-18505-1-git-send-email-mathieu.poirier@linaro.org> This patch frees all the memory allocated in function cs_etm__alloc_queue(). Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> --- 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 b9f0a53dfa65..f2c98774e665 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); } -- 2.7.4
next prev parent reply other threads:[~2018-02-12 20:32 UTC|newest] Thread overview: 13+ 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 ` Mathieu Poirier 2018-02-12 20:32 ` Mathieu Poirier [this message] 2018-02-12 20:32 ` [PATCH 1/3] perf tools: Freeing allocated memory Mathieu Poirier 2018-02-17 11:28 ` [tip:perf/core] perf cs-etm: " tip-bot for Mathieu Poirier 2018-02-12 20:32 ` [PATCH 2/3] perf util: Use target->per_thread and target->system_wide flags Mathieu Poirier 2018-02-12 20:32 ` 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-12 20:32 ` 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 2018-02-15 14:55 ` 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=1518467557-18505-2-git-send-email-mathieu.poirier@linaro.org \ --to=mathieu.poirier@linaro.org \ --cc=acme@kernel.org \ --cc=alexander.shishkin@linux.intel.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=mingo@redhat.com \ --cc=namhyung@kernel.org \ --cc=peterz@infradead.org \ --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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.