Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2906453ybi; Mon, 17 Jun 2019 12:28:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+xXk9nQp9H1RXbgdMQRpukev01i3oViib3n4wy4q6+h0v0cOBH/IS2IYd2ZOpp3lDNkdV X-Received: by 2002:a62:bd0e:: with SMTP id a14mr15917676pff.44.1560799538193; Mon, 17 Jun 2019 12:25:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560799538; cv=none; d=google.com; s=arc-20160816; b=0kugFsZhHrGuIaEa6rxtBwu1l4+2sZIoEOQ0FlM6vH5oA44o1Ef1ru+EkIzz7rTob1 lfot7CDRrtx1NOQmlF3WFl5+y2JgGocLiQPyCoCq4DsJpcLqWFf2eesGDVvV91UFHJUl z4NvdNWS5QsndDAekPUhFgEmyFBjeH+D8lsN0FBkNIfZ18lCJzPHRgFvC7ATr5KxLeTY XXEJRbrF5QMiRqHe/TvH1P+AIl17gc5LykuKcgHn8JqlGLfGVzrs+TUgP92FuQpRcW5R wPbSPpd+aZQ5besNaGRQrvTq/pgF6fvAqq+xvvy83xJvZzI2lz698B9QDgJR4/c6Le56 BVsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:dkim-signature:dkim-filter; bh=UfRS/s43/jQRx7zMDkXsPBH2z5HCMWUOvSMIjsEMIw4=; b=Zio18BhKSG4FNrlLt1VzD+zGHYE5ZWiuf97B6K+jSuuMUqVCshDg7jEq/Y2DMTQ4y1 nDXEEybY5NbT4oPMmTU/KBb9buhtPg+yOgmgJVvRmA5eW2xSmTjwtSErml/PKCc9Cv1S OdIxxl+dan+Cx1cgZArPpZIc4AWdPfs6Do4GSIjGf7pefwxdzuDCLe1si8F9ckHepm4d C1afJv24stoB6QzCeh4JQ5lyvoQ0sRPzN+tHdvTMWb76PxNKISndunQs2uiwzJVDuENO FWLBwsfL5V0WjdlCvpjm5dJdw6P+OAIhkgOYuJO09qPfplnuG2kh+K7xkakDD2zP49g0 bWSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019051801 header.b=VV5jfWMF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k24si10952399pfk.195.2019.06.17.12.25.23; Mon, 17 Jun 2019 12:25:38 -0700 (PDT) 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; dkim=pass header.i=@zytor.com header.s=2019051801 header.b=VV5jfWMF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728948AbfFQTYD (ORCPT + 99 others); Mon, 17 Jun 2019 15:24:03 -0400 Received: from terminus.zytor.com ([198.137.202.136]:58915 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726623AbfFQTYC (ORCPT ); Mon, 17 Jun 2019 15:24:02 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x5HJNdr13561096 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 17 Jun 2019 12:23:39 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x5HJNdr13561096 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019051801; t=1560799420; bh=UfRS/s43/jQRx7zMDkXsPBH2z5HCMWUOvSMIjsEMIw4=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=VV5jfWMFHUY/oZMgwZLLtd/0uls4uMBOvZdj5zLZohc2lDewWQ9Ig1/unRwvs65kU YXAe4P+amToMxTsF7cT/sfTZw98qv7ERllNy0IVIQjmn50FWFRHcgu+yrm/dYFfGwN FW2kI4+Kp9nvzL3NArlifiK6GG5k3bO6VGGFFz+MX9581fbohetltWKohnfJ8oWdSA 8TA2tD5oumKSGC5vcfpPgfiEBD72SgKlo4hzXF+Ag9/2fl4LiJgZRALw9lJHqNp6YL LP1D8EHj9SCNclBL1H9Ey8x/vATzCe5j0nfgF0oBYyE3ACsoUqHXbCJBTpV3pw4UAf 1H6jrrcSPy0tA== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x5HJNdeu3561091; Mon, 17 Jun 2019 12:23:39 -0700 Date: Mon, 17 Jun 2019 12:23:39 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Mathieu Poirier Message-ID: Cc: jolsa@redhat.com, acme@redhat.com, peterz@infradead.org, leo.yan@linaro.org, alexander.shishkin@linux.intel.com, tglx@linutronix.de, mingo@kernel.org, suzuki.poulose@arm.com, hpa@zytor.com, mathieu.poirier@linaro.org, linux-kernel@vger.kernel.org, namhyung@kernel.org Reply-To: peterz@infradead.org, jolsa@redhat.com, acme@redhat.com, tglx@linutronix.de, suzuki.poulose@arm.com, mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, mathieu.poirier@linaro.org, namhyung@kernel.org, leo.yan@linaro.org, alexander.shishkin@linux.intel.com In-Reply-To: <20190524173508.29044-7-mathieu.poirier@linaro.org> References: <20190524173508.29044-7-mathieu.poirier@linaro.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf cs-etm: Refactor error path in cs_etm_decoder__new() Git-Commit-ID: 3470d48a4ef30c554934d4a188a97a53656bff57 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-Spam-Status: No, score=-1.2 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_06_12,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, DKIM_VALID_EF autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 3470d48a4ef30c554934d4a188a97a53656bff57 Gitweb: https://git.kernel.org/tip/3470d48a4ef30c554934d4a188a97a53656bff57 Author: Mathieu Poirier AuthorDate: Fri, 24 May 2019 11:34:57 -0600 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 10 Jun 2019 15:50:01 -0300 perf cs-etm: Refactor error path in cs_etm_decoder__new() There is no point in having two different error goto statement since the openCSD API to free a decoder handles NULL pointers. As such function cs_etm_decoder__free() can be called to deal with all aspect of freeing decoder memory. Signed-off-by: Mathieu Poirier Tested-by: Leo Yan Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Suzuki Poulouse Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/20190524173508.29044-7-mathieu.poirier@linaro.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c index 39fe21e1cf93..5dafec421b0d 100644 --- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c +++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c @@ -577,7 +577,7 @@ cs_etm_decoder__new(int num_cpu, struct cs_etm_decoder_params *d_params, /* init library print logging support */ ret = cs_etm_decoder__init_def_logger_printing(d_params, decoder); if (ret != 0) - goto err_free_decoder_tree; + goto err_free_decoder; /* init raw frame logging if required */ cs_etm_decoder__init_raw_frame_logging(d_params, decoder); @@ -587,15 +587,13 @@ cs_etm_decoder__new(int num_cpu, struct cs_etm_decoder_params *d_params, &t_params[i], decoder); if (ret != 0) - goto err_free_decoder_tree; + goto err_free_decoder; } return decoder; -err_free_decoder_tree: - ocsd_destroy_dcd_tree(decoder->dcd_tree); err_free_decoder: - free(decoder); + cs_etm_decoder__free(decoder); return NULL; }