Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3714010pxv; Mon, 26 Jul 2021 10:03:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQRk9rrJbK1ZIIWeTqBeXZ4DTcmSE/DDfLq8oeS896Su3nLHMHaUV7OaxyWvw5kPyuWKV1 X-Received: by 2002:a05:6402:b83:: with SMTP id cf3mr7526868edb.12.1627319015375; Mon, 26 Jul 2021 10:03:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627319015; cv=none; d=google.com; s=arc-20160816; b=pIs5iV02bQ9sLtaaU30oPAGDSM/ms24rZrxg0KF+r2O2zK0rTf9dXt4Rh7w9NUbRts q570wpbtxanrHvYpJHJ35dUIcrWkcUCCpRPVbCIA+swX5GQGAA60HBySA7OMrV5kelTy Hb50OinMDhfbkKU7I4hn/ige6L+barWP3314GY+/CRKGqGrEAQflw7FhIP8dp+IVi12A fy1dEPU+3zfaQDo8SNxFNHj2B5Yy23+wTuIWrUpBTB0bAOn5fwJb66JH3KadSKvNENTi 6rGDUn4hyEoZdZ6Z+xJEnV3tWdQbiD5n8HRdpRva05FgTz5U1AeXLS4flhmKjgtdcCkH oC1w== 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=2kVnYoXEr5UI8yUAOndq2TTqNcDcm0J6LSa4iWj9tu0=; b=qrkgZcXDLFBazDzoefJcGKrr2XFdcTYKd+3p6zRiyvgfIP5C4VvbBE5NmjKejhYR/a L0YqjKrtTczwffVyCJZ2no8CVVxIkjBv++3DIbeCKyle1rq5laQ19vHehOiEH9JMeaNv zTQbHFLhUM34KTx/F6UQJtT2Dr4ZRGbyVSD3NCsERLBweJ9hab6SYvJg8tlVxjekQxNc X2i/bmREvn4/exY8QUC0sLaxehc/SZpkpBfFQgXAFlMcLj/ppuqStZ7lvH8JCewtg4lq HlO3KKHI3R2nPNag8EbbtDF8+uz2HGJjphkgfqgR5X/EIWeipJpiGGLRFBDNGD3EJmbC +iXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pwnQK+Wm; 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 y17si523380edc.137.2021.07.26.10.03.11; Mon, 26 Jul 2021 10:03:35 -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=pwnQK+Wm; 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 S238318AbhGZPjc (ORCPT + 99 others); Mon, 26 Jul 2021 11:39:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:37026 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237335AbhGZPWZ (ORCPT ); Mon, 26 Jul 2021 11:22:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9B44A60F5A; Mon, 26 Jul 2021 16:02:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627315374; bh=dOyU/jTonwnSLfo73VTuw12SSwAoLPTF2ThdAbPs2q8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pwnQK+Wm1/p+gtp6DeTs6HZGRwFL67elrbECbWKgxv/E39F/O4W2/fWVn3xZDCNpO L95+BkYRSq4zBhtOrbqX8SVITcd8l5LMWTOXEPXk3ojXLh+hWxhJ9KjU1XPpt3z1sw mk4sIvCiAuFshjECuS6Il9JhUGsaSoP+sIMi5bvY= 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 037/167] perf test session_topology: Delete session->evlist Date: Mon, 26 Jul 2021 17:37:50 +0200 Message-Id: <20210726153840.631599092@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 233f2dc1c284337286f9a64c0152236779a42f6c ] ASan reports a memory leak related to session->evlist while running: # perf test "41: Session topology". When perf_data is in write mode, session->evlist is owned by the caller, which should also take care of deleting it. This patch adds the missing evlist__delete(). Signed-off-by: Riccardo Mancini Fixes: c84974ed9fb67293 ("perf test: Add entry to test cpu topology") Cc: Ian Rogers Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/822f741f06eb25250fb60686cf30a35f447e9e91.1626343282.git.rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/tests/topology.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/tests/topology.c b/tools/perf/tests/topology.c index 22daf2bdf5fa..f4a2c0df0954 100644 --- a/tools/perf/tests/topology.c +++ b/tools/perf/tests/topology.c @@ -52,6 +52,7 @@ static int session_write_header(char *path) TEST_ASSERT_VAL("failed to write header", !perf_session__write_header(session, session->evlist, data.file.fd, true)); + evlist__delete(session->evlist); perf_session__delete(session); return 0; -- 2.30.2