Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp677917pxv; Thu, 15 Jul 2021 13:14:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnDVM8svn3RM0ZrVT2TmWt18kmLpIqE305xcqTg7ar5jnixclVXS9AGFRmpidTEL/IBEgE X-Received: by 2002:a92:d07:: with SMTP id 7mr3719736iln.114.1626380086287; Thu, 15 Jul 2021 13:14:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626380086; cv=none; d=google.com; s=arc-20160816; b=ljIHW9y3F6zm9M8+kXk0X5oz/weJVBKCoTtltpeFIlPLsS/u9zoNHOIQcRZOBzyrMD 7jhBkecTJiJl8yv2kTMJI5WjQzi8uFblv7ucsBVaORWdJ9p/bea2Ul58hZkcTqr/K7Xj nQZv7JzLTlQwr3XLUuyNxIy4mXB/fURXkyeO5gh/3T9qJp3Rc0kn7JoQjCMidylH3zk+ JQGqh2dFQ8IFZx/u+VQc/FdFOuLAqY9y/3IX4zpILBE+Vnbw+RsTt5oiEDRvklRFWhOF zfR2FQZ/JFpbt/aDvTpNRiv6SaZDcokfvUYqDC9Qb7k5u82aESpJVH0CCP5h3gF3RzP8 F0Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=K89vNNlLAf9PlYXs3PA581ls9BaLtCCocn8gZBPaMt4=; b=PLkaO2Ts4z1NjDULQ5MFqikokGJxHrJeN0OEFyQq654E+uqH4V6F8v2bq550vpiEkP UuiCWWGiW28UBjzw57Pn7uKgbW1nOxh86Yvc2Cz5ZYE3+z1uyHejJ4jEmuyvMEWZ8HRE aswT0m3E8irVrt05y3v546UtAeK13By0oBTxwXzHUwonDb01vC5S5ShK1A8BB1AWXPOL pgMMi4R/kYLa9cfOpNQgCQsSxKWiZmTniW5U9LNdWkB8hcIOsubR9ZACvSasVrWMMAMu /y4lKwzQeHOtNX6Paqw87OMfVOk/WWyU++3s9W5Qmi8XGDRUKkE+kWjnW54nNOBdrkna Uo5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lEjied8b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z24si7966423jap.49.2021.07.15.13.14.33; Thu, 15 Jul 2021 13:14:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lEjied8b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240557AbhGOUPh (ORCPT + 99 others); Thu, 15 Jul 2021 16:15:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:50164 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229700AbhGOUPg (ORCPT ); Thu, 15 Jul 2021 16:15:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8B0FA613C4; Thu, 15 Jul 2021 20:12:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626379962; bh=r6C0Mt7szLsEmJYWUx/QjykST9P+Liwu7CI1rc81z0U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lEjied8bBLvPrPlYDVr1VTtjn89Lx4aoVSl71Zs9wcxq0IM0FPQgTPzediUGe2g4/ clP3zSHga73Uuyuq/is5+fVEt4ypVYBo42OCnnlpSsJAQdCDeLGohsjyMEBUrNjb0j elGhKH+TFVOiZWT7L9vEurlGLcycwKEW3Uzz8uwjOswMxy/JunsOP2om4irvmqHhp5 m18Ko4+b8cmV4l/xsPwkNKWEN7stDhb0ICZ77/WYJ3+4OhJuRny+M7uORAcE8LCx7f h9IBWxhjOo1R7miI7nYbmxZy4YZLFqKUpb+9CZe4Ho10yLrJcPSmLPCmmZ+mdHcWOI vFUrdmdk/dfPA== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 26FD1403F2; Thu, 15 Jul 2021 17:12:40 -0300 (-03) Date: Thu, 15 Jul 2021 17:12:40 -0300 From: Arnaldo Carvalho de Melo To: Riccardo Mancini Cc: Kan Liang , Ian Rogers , Namhyung Kim , Peter Zijlstra , Ingo Molnar , Mark Rutland , Jiri Olsa , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: Re: [PATCH 08/20] perf env: fix memory leak of cpu_pmu_caps Message-ID: References: <6ba036a8220156ec1f3d6be3e5d25920f6145028.1626343282.git.rickyman7@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6ba036a8220156ec1f3d6be3e5d25920f6145028.1626343282.git.rickyman7@gmail.com> X-Url: http://acmel.wordpress.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Thu, Jul 15, 2021 at 06:07:13PM +0200, Riccardo Mancini escreveu: > ASan reports memory leaks while running the perf test > "83: Zstd perf.data compression/decompression". > The first of the leaks is caused by env->cpu_pmu_caps not being freed. > > This patch adds the missing (z)free inside perf_env__exit. Fixes: 6f91ea283a1ed23e ("perf header: Support CPU PMU capabilities") Thanks, applied. - Arnaldo > Signed-off-by: Riccardo Mancini > --- > tools/perf/util/env.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/tools/perf/util/env.c b/tools/perf/util/env.c > index 6c765946ef6f591c..cec2e6cad8aabfe7 100644 > --- a/tools/perf/util/env.c > +++ b/tools/perf/util/env.c > @@ -191,6 +191,7 @@ void perf_env__exit(struct perf_env *env) > zfree(&env->sibling_threads); > zfree(&env->pmu_mappings); > zfree(&env->cpu); > + zfree(&env->cpu_pmu_caps); > zfree(&env->numa_map); > > for (i = 0; i < env->nr_numa_nodes; i++) > -- > 2.31.1 > -- - Arnaldo