Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3672722pxv; Mon, 26 Jul 2021 09:08:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdGEL3JOOjIyJOS1q0miKhwXxxp9eW6mAzslyAHsUhCTySwetE/WNtESyWrPSmi8pAiqdn X-Received: by 2002:aa7:ca1a:: with SMTP id y26mr22640604eds.231.1627315692452; Mon, 26 Jul 2021 09:08:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627315692; cv=none; d=google.com; s=arc-20160816; b=N3lgfiUiTc3qm2H8fbuiA4q3LMSCH7fdhr3dIdSqmVFuEklLZvH+dGFJih5IdTo/aW OOkC3wDrb4xdnLQCp0N8jhPrrIgmCmfaj9fNvD7n7DRtmrb3gIj2swmOap31v+hbdP9I zh/tyizSowQtv/z80BuHoDdaYzcDRQJlfuZfIZ9bHE1H5prr3xfZJRqdFtcQH5IL9wI1 kY0wZUkXIPwTTxU13WefpPZ+/rt7y356wpTTrrI5xVWQQB9AMGFbtJv5BRntp2Qeuvm7 fvvtzedXs/+Yy7iAxiBGWMrGdgPRSgrwPTx8fOq4XKXZ9VhdZ4M7WljrmepaO125NlvE n1VA== 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=kJC9XVp2gaR5I/660FKVmxMaUJuc0wSUcLCBv5u4hQc=; b=H6i5Yc2XUJbP/garc0QSagSLznYNLcxfneDD8FFBe9zJuruQHOiK605pwst/ZtAb/m HjZJDHtkFFWhgYqh2r3kmCUZBv8KqbBOGLv4Bh40OlwS3wF+ICmxp6/AndGpFJum9JXN dHo1ldusTrPgb8TgbsIAQhxh8FXZTYQ+X0Gy8WQg3mLZ1ycuwMdpXF4x2/rItD2VQmJq 7GeLATtk7DZzOPpl8cWGZS0Ie/nxscoLp37l04GepB2rp98Sv8b5PuzkGnMHTOJ7VGdQ 39Unm1YPQMFVkLyMX8nSPl0OyY1zl9uWQcsmhLWjWhR782U399QB8neT4ETQ5/fQhAIN 5X/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pvjHV+8f; 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 nb2si249339ejc.741.2021.07.26.09.07.49; Mon, 26 Jul 2021 09:08:12 -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=pvjHV+8f; 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 S236955AbhGZPXG (ORCPT + 99 others); Mon, 26 Jul 2021 11:23:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:53270 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237448AbhGZPPr (ORCPT ); Mon, 26 Jul 2021 11:15:47 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0FD8161078; Mon, 26 Jul 2021 15:55:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627314947; bh=mLYfk4xy2wIZmbtXymCaqFUhwA/CAGmnWse1UowfJpQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pvjHV+8f0C0Sx4z7Cxoc8eem2tc/F673Q9mUFtnh2dwaiMJWoS3LXNKc5JnCD+ldF 1SROJvXioPwdU2H8y18ikSQxmI4Gx13WFfOfS5nVE1ym09uy54UXpJNo5PTL6lgFUz zC1yR6sQdvdEA4FUgpyDk1f3t8bfewNPfppRnRcw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Riccardo Mancini , Ian Rogers , Jiri Olsa , Mark Rutland , Namhyung Kim , Peter Zijlstra , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 5.4 022/108] perf env: Fix sibling_dies memory leak Date: Mon, 26 Jul 2021 17:38:23 +0200 Message-Id: <20210726153832.404684507@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210726153831.696295003@linuxfoundation.org> References: <20210726153831.696295003@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 42db3d9ded555f7148b5695109a7dc8d66f0dde4 ] ASan reports a memory leak in perf_env while running: # perf test "41: Session topology" Caused by sibling_dies not being freed. This patch adds the required free. Fixes: acae8b36cded0ee6 ("perf header: Add die information in CPU topology") Signed-off-by: Riccardo Mancini Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/2140d0b57656e4eb9021ca9772250c24c032924b.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 018ecf7b6da9..0fafcf264d23 100644 --- a/tools/perf/util/env.c +++ b/tools/perf/util/env.c @@ -175,6 +175,7 @@ void perf_env__exit(struct perf_env *env) zfree(&env->cpuid); zfree(&env->cmdline); zfree(&env->cmdline_argv); + zfree(&env->sibling_dies); zfree(&env->sibling_cores); zfree(&env->sibling_threads); zfree(&env->pmu_mappings); -- 2.30.2