OSDN Git Service

perf cs-etm: Freeing allocated memory
authorMathieu Poirier <mathieu.poirier@linaro.org>
Mon, 12 Feb 2018 20:32:35 +0000 (13:32 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 16 Feb 2018 17:55:39 +0000 (14:55 -0300)
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

index b9f0a53..f2c9877 100644 (file)
@@ -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);
 }