From patchwork Fri Feb 16 19:17:25 2018 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: 128633 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp909234ljc; Fri, 16 Feb 2018 11:36:08 -0800 (PST) X-Google-Smtp-Source: AH8x224Xf/iSYqQVM/PiVoo3K+9KKEe2i8LztqUEltjZ6yh/gGvnFBygI8QuHlMYsplObxzH+cv0 X-Received: by 2002:a17:902:9a84:: with SMTP id w4-v6mr6831324plp.136.1518809768400; Fri, 16 Feb 2018 11:36:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518809768; cv=none; d=google.com; s=arc-20160816; b=amE0IaYOnzbmZoivDJjzCPqDpz51UCwc7dQo1ICVIvWtvaNYfQnMs8ZY35IPvr/JWc +8ckNKCjk4pYPyMR7TM0n0vorbTNIY1og6v4kxw8uoiLE5AkKLKan3psZ+KEhkMn1vXB ZX+7+KUKrDKRR8jtlRr4vtizmbHPW9YS9n9bvUV3/K7psybsKi6ZbakwVTSmeVJNHrZR lEtyYG37acuh1FWtaP5ufYKe/jTR2o2pkYbWEteIoNgVMYo98DbUYtYNBbthS+TbXHtR p9qIipUIGpE6YmmOlB2kGn+7ORuEFyQIKunQ81nu5dGymQDjfhzCZeVSXLjV6lFwpTfw G05w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:arc-authentication-results; bh=6SqXMQ1VG0TGa0bgvS3txW6NqUXp1HNAEN9SEpuuYIo=; b=gSMvrEg6OEjhBaiTSntKvaBdFAsPGdmq/bNBWur0j6G/HNwb8jLZxuz2feSEIWpFgU /vs6gUS9UdPVMD3WYR3IGFNq06/TcPgK97Dvk1folGL/5PWIEMXhHtRlVf9uNlqibUi0 9wfwEu2k2BSVsR/dqyZGMITQvZQ+1di5eIODCkXQ6CEgqnDlCj0ojA1EAfE29gGh1hu+ 3IOeEMkXkwkbC5IiTx0bNFOk5Rj/fSR/sjshcYPc6xIE2fliBbFfZ62dTUVbDkmiLugn l89tJYWusU7SisFjiymHkZbmJfIbG7s4JsPD7tndJHNg/mt9n15Fzg28BQMjJaNnxpQw 3pEw== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w5-v6si4596249plz.426.2018.02.16.11.36.08; Fri, 16 Feb 2018 11:36:08 -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 S1751359AbeBPTgB (ORCPT + 28 others); Fri, 16 Feb 2018 14:36:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:56500 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753637AbeBPTTM (ORCPT ); Fri, 16 Feb 2018 14:19:12 -0500 Received: from jouet.infradead.org (unknown [179.97.41.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 08272217D2; Fri, 16 Feb 2018 19:19:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 08272217D2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=acme@kernel.org From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Mathieu Poirier , Alexander Shishkin , Jin Yao , Namhyung Kim , Peter Zijlstra , linux-arm-kernel@lists.infradead.org, Arnaldo Carvalho de Melo Subject: [PATCH 20/41] perf cs-etm: Freeing allocated memory Date: Fri, 16 Feb 2018 16:17:25 -0300 Message-Id: <20180216191746.11095-21-acme@kernel.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180216191746.11095-1-acme@kernel.org> References: <20180216191746.11095-1-acme@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mathieu Poirier This patch frees all the memory allocated in function cs_etm__alloc_queue(). Signed-off-by: Mathieu Poirier Cc: Alexander Shishkin Cc: Jin Yao Cc: Namhyung Kim Cc: Peter Zijlstra 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 --- tools/perf/util/cs-etm.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.14.3 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); }