Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp544097pxv; Thu, 15 Jul 2021 09:54:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyscsIxbTsLPkcxMv9+hgZqweW6OnuxenSnFno5+6RGTVB7QYL/OGM9op845hSmqigtNwJP X-Received: by 2002:a02:8521:: with SMTP id g30mr4832650jai.113.1626368083746; Thu, 15 Jul 2021 09:54:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626368083; cv=none; d=google.com; s=arc-20160816; b=JcCmDF9XHF74x/3WOJ9ukutzBYiwZG0XC0UwceQY0Fp40wBROIILD2DBcIQRQbS2wm iRzr9Mjc1J4bbWaPLkES3AHpp+yV7fAd/cydB/RtlGfFWAHUwLTJFW834oKtWa2fNEw2 WAx7EOLqiVjGMYeamfo27GtxKo6zUoFTDmklKCt5gFcDNFw2EemuLq2+z1nzK/p+r5B6 bJ+IL7Ab923xSlrQWYQcuUV27N77xuQB/z0OJ2J95qCjcjQ3v7brgbsUMoURIc7Lp/GB 3hFJaD5P1eDmRxIs3yjRnwCtEtZ2nlvTwGsU91q205UMvsm58qf0A4/3/Mwedilq9iIp /Qfg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BXFdRwfSh/bEwWtJAAKqaZ/Dfgb0l78ZFWkOfVRAIR8=; b=EO+D5XNTHfC6n9yD5M32K/1GdPNP263QFf403uYoRjDGf4mEQ129K5MU3fwo6+axtm 9YNWt61GLPiIGgPrGo6usP4W9PMpfUY/WrGHMo2GK15N+1/BksiP4Q+sKpBI5XDDg2x+ mRsgaCP9Ijobhg8ZqXLcOBV7+zr58qU5bLk44dXRDahkzYU/E2S9/Enn4AkuGPbhRcJo NI2cmSDa+qCGay5036CxidP2zlj7nhdltX8wBj8guycsHNBXOU1RTWDnIZgU7Ys95xKh eb0UcuzvO1r25PPgGQT15+ah8zpKYWbCP5bYxISy7dSyqFZfhE2MEfiBAfNS9paNTPzS n4HA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="s7QAG04/"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ay16si7570515jab.96.2021.07.15.09.54.31; Thu, 15 Jul 2021 09:54:43 -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=@gmail.com header.s=20161025 header.b="s7QAG04/"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234967AbhGOQKk (ORCPT + 99 others); Thu, 15 Jul 2021 12:10:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232404AbhGOQKb (ORCPT ); Thu, 15 Jul 2021 12:10:31 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFD9EC061764; Thu, 15 Jul 2021 09:07:37 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id v5so8502314wrt.3; Thu, 15 Jul 2021 09:07:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BXFdRwfSh/bEwWtJAAKqaZ/Dfgb0l78ZFWkOfVRAIR8=; b=s7QAG04/uowor3SEV4/GhhxGEGNY/ExxjwKTHa0V0AIoGa4Kf5XxX6q+owJh1DCCme r3z9XIBw/7JWTysK5sB6hnPpz4flnyI2EWXDJl5jSm/pIgClWoVMjCqbIRKt3IL+scoL URWg5tq79kb9stUL43kVfR2cIMvFepSaujievngMiWU4eK3HdGNwXzgiA6r1CNjFLNAM ANskkpb5fyU+GJBx9YqpyUqpK9bClrkaGrzPNXMz6yUhREQCLQFEhQODBlPVYUNCC1Xp VqisP7FQGVEi/Pqd8hJ310d4+GxTRlgz6jqSCK+tjKJs1s5Vjpj88swLoa/56yC01/Cd tKfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BXFdRwfSh/bEwWtJAAKqaZ/Dfgb0l78ZFWkOfVRAIR8=; b=LO6skMq4rwpB8uRy7MD4wK10VvRuDEkTXoDLH2PuUZjwnutnhS5TtgLj9WDM+qHKJ4 wWVx3CkqEgfuaj3yxJ7ENkQzTDCamCDxMYPvC3IE3eAvsSRQ/15SDwWd3mZpCS7QFVLB qo7AWANkyzvxlofqm/HEBSTA/sG2IbgKgdJEB/x6qhGQQ6WhcdAnDzPmD2gic8aaK3SL fHxhG+1mtWlaohmGKpIVMSN5wHAB4A+tfn4XzfKNkLvQXpZv7KKbo4e4NzhR800jSFfJ CMmmXcxlsAooOZdx86yPG7SddzI+prXzQD54WR/GAXA6H6UANralgxPr0AeMAwsYZcqt mllg== X-Gm-Message-State: AOAM532E2iO5HGHLQW6vsCeAqrzPDXYi8Rc8ZLR5XZ/4VtvHJfVr3uVk cyjifEk3HbdK4HVa79uStT0= X-Received: by 2002:a5d:408f:: with SMTP id o15mr6645193wrp.342.1626365256439; Thu, 15 Jul 2021 09:07:36 -0700 (PDT) Received: from honeypot.lan ([2001:b07:6456:fd99:ced0:db1c:53e1:191e]) by smtp.googlemail.com with ESMTPSA id k13sm7446952wrp.34.2021.07.15.09.07.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Jul 2021 09:07:35 -0700 (PDT) From: Riccardo Mancini To: Arnaldo Carvalho de Melo Cc: Ian Rogers , Namhyung Kim , Peter Zijlstra , Ingo Molnar , Mark Rutland , Jiri Olsa , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Riccardo Mancini Subject: [PATCH 08/20] perf env: fix memory leak of cpu_pmu_caps Date: Thu, 15 Jul 2021 18:07:13 +0200 Message-Id: <6ba036a8220156ec1f3d6be3e5d25920f6145028.1626343282.git.rickyman7@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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