Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3713467pxv; Mon, 26 Jul 2021 10:02:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqZJnecZCCeEckNrrYN4kOg6stcBHAp/TEiE5+RXHIvK+xDj+i+pAaM1hidobjZAoKoaRY X-Received: by 2002:a17:906:f746:: with SMTP id jp6mr18164358ejb.39.1627318972593; Mon, 26 Jul 2021 10:02:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627318972; cv=none; d=google.com; s=arc-20160816; b=IWefaFW4LfEjqaI/uoLIp5J6zK8P49gKU8mT/+mD055B9L/2mBoOb0sBYoGbg89En9 FHq24C0HmEiHN80Op2ClyntHeF3jZHe7Pcr2Qr29Tv3axSpjIzyXlAntWuyZ9aHDXTO5 9VkopsK5kMd5SOkgf/aJn1DBXCp0vgqpnkexedOIsaDTrqTX0ol1nnIIqcRoJXDowKXK WU7gYfRwJsXaDkBMA3+HSZes5Zt8joNoZoccBp75dVqI79ziIxLhYrRDDi8+gmOwT7d2 EnUnQb1jCY6IwCwODIw1ZXuJxaSsdjEo+B3zVgdWd3QyTTlzmuAUVH5HFg8f2WZATyCX SleQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KWdU1uH5vONthe0DxR5d+yAFh63KLtzYeUE3+lPPr8E=; b=QTOfq6EPEkJH+WfA5gJl3W3L5Tj4fmZl/bCdVW7PgYl8yLuUFos2GIU28jL6gQcLOW t7ppXxlf86GUV2pMzUSC7s8QMQDIcmAl30LpGmH1nAguclTARyP9NuW909+3pMGzrs0D ClzY9ipJxf11HtCgwDT1c5uGZsAI3gsEXFuMky2zyegxa7VtELWZeYXI8irdMTgBMVUe AY0cfAtFXwIIngisv87+zWJZuhNvWsjBTtti6R2I0Q+yPC2wozyRUR8PWqOOjk+u29oV ezQYE+C/V0vQbe89Pc4xrL27jT3Q32gvb2Z6tBZSB29YQRxrxVcHgE35rz+CADZZaQB0 ONMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xiH9CpMC; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p18si427011edx.261.2021.07.26.10.02.29; Mon, 26 Jul 2021 10:02:52 -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=@linuxfoundation.org header.s=korg header.b=xiH9CpMC; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234419AbhGZPgi (ORCPT + 99 others); Mon, 26 Jul 2021 11:36:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:35084 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237120AbhGZPVH (ORCPT ); Mon, 26 Jul 2021 11:21:07 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 776F260E09; Mon, 26 Jul 2021 16:01:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627315295; bh=kANN+UO/GvHzlAxWd7HjBi8v0Xy8YuHGs6VCqfx/xJA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xiH9CpMCK/LaU1q9td3gWJV6TXI5Rg2SWXkvDIDWr1RlNmQFDRMV4UqC6T3jvBL2D ODSqyMWJjxZalBtH5Is/CslW13EFrIJG1B/d8J/ds4j8vqlbV6I6Rxi41hNVx7pX2H UQdRI6/7H94t9CpRT2f4x1XlEtoQaZQOau8xhfSU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Riccardo Mancini , Ian Rogers , Jiri Olsa , Kan Liang , Mark Rutland , Namhyung Kim , Peter Zijlstra , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 5.10 041/167] perf env: Fix memory leak of cpu_pmu_caps Date: Mon, 26 Jul 2021 17:37:54 +0200 Message-Id: <20210726153840.770461878@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210726153839.371771838@linuxfoundation.org> References: <20210726153839.371771838@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Riccardo Mancini [ Upstream commit da6b7c6c0626901428245f65712385805e42eba6 ] ASan reports memory leaks while running: # 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. Signed-off-by: Riccardo Mancini Fixes: 6f91ea283a1ed23e ("perf header: Support CPU PMU capabilities") Cc: Ian Rogers Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/6ba036a8220156ec1f3d6be3e5d25920f6145028.1626343282.git.rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- 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 744e51c4a6bd..03bc843b1cf8 100644 --- a/tools/perf/util/env.c +++ b/tools/perf/util/env.c @@ -183,6 +183,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.30.2