Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3712114pxv; Mon, 26 Jul 2021 10:01:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfMtoryR1DtwhcS3d+X+7do4RVTPH1NgvxuKOQyB7W1V79NZU/oDIjCJUpi+Te1mIxK1gp X-Received: by 2002:a05:6602:2406:: with SMTP id s6mr15296873ioa.159.1627318881381; Mon, 26 Jul 2021 10:01:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627318881; cv=none; d=google.com; s=arc-20160816; b=xU93oDI5uSmpVxrAxGcJgOHi6yPyZUccgfnQo2AeKicnWkHHDiLgU/wEs8wMHQ7PZ0 tVdj3bOPx0unJ3DN76yI7hIsdbdJdCSFiXflMcFRW86uHAjB0NnVU8aWzOdwWO0xl1pn /y7V7nMRWEn3cftmh3slLuOVw15SBZeRxnT8TYgmiE15q5yAi1VZeDJTcD6YxAyq5kv/ qTOQ9nfF0IDL1I3dV5bFGTh0ukf5G2mUSEq83o/DyslxCWHL0+YC09O6LAWBkiETZ8Ug 77ID50F3N6mUX88Cnc4Xj7JUHzy0INX756XFgtJZvKm/G+dq7KyKv9hKH8MnDYxI79Rp S8Jg== 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=X59R1ai0PFGkyp04yb3SsIm6SCQeM3Ythq3FuYZtrNo=; b=APSPwoUt4WaS8Q1GLYAcPY9I9WkSSTGvOAh+jr2yGO/QbxP5EKNbtk42j/aZTDmkEX aeLjgMY5n1+7QsKeBzO8O3lRxhe8whFVTZm/ItTzB0S2mV/4fHEqagwADqYINPsNr0d0 1oXTmD4Vvu3RT2Zxp42I/k3OmN3jv23Ig/H71xZ+BTc0RyDBX4+YGFVaLvtvFvWhoMIC TbYxcBUJ3eq6PCfWSMxIFpiWQaTnI4YuSl0ogQfHk8uZnTahP0QO0sfIvw/4yGJD3SFc xg8VKvgXlGTtsj3FJKDIfolBN3OSKwa5GqCxFexONWvzrM1C5EJu074g0fBE1AwHmFTl qnng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VCqzEZR0; 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 x25si422288jaq.11.2021.07.26.10.01.08; Mon, 26 Jul 2021 10:01:21 -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=VCqzEZR0; 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 S238215AbhGZPjZ (ORCPT + 99 others); Mon, 26 Jul 2021 11:39:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:37048 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237319AbhGZPWX (ORCPT ); Mon, 26 Jul 2021 11:22:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 88C6E60E09; Mon, 26 Jul 2021 16:02:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627315372; bh=cVGMIjXiW9ylHd/dFnWgStv+fD3pZiwnVCRzOXd5xK8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VCqzEZR0iDvk3qqvTpQTEgCssD6bZuTjEZ1xVP0UvdmCkSejg9IkmsVRVVurP7sOZ kGYhLikzulIf16aAmKeo+7CYOf+hAVm0+uC3APVPXF8egqveJTMsV0MaxrslpnbVNg oI0Ct9ZcOMoaJOzYDiW1i32+scRbES75PlDGXoo4= 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.10 036/167] perf env: Fix sibling_dies memory leak Date: Mon, 26 Jul 2021 17:37:49 +0200 Message-Id: <20210726153840.593524943@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 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 fadc59708ece..744e51c4a6bd 100644 --- a/tools/perf/util/env.c +++ b/tools/perf/util/env.c @@ -178,6 +178,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