Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3675451pxv; Mon, 26 Jul 2021 09:10:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyaQEGNP4wZVr8P3/Ex+qDlr+SZqGbDz83jV+K2eqMqu3KrHlNLI8ZntH8eY5xGOKH/ePYS X-Received: by 2002:a7b:c041:: with SMTP id u1mr17345372wmc.95.1627315859729; Mon, 26 Jul 2021 09:10:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627315859; cv=none; d=google.com; s=arc-20160816; b=oQzagdy//hWhv8Cc6kZMqqHrsSWw26B9Y1pKwndKCfOkaGwhdNY+weXfcmsv9GCxpX cW3edn0Kf+eFzMI9PGNRvLkPlhRMqbLaNG5Peg4jacwFdAsRFZFCp3AWOzkIOya9spHX WZqLF87jHvVg8Ot5Dh1RpVKkW7f40Ykwit+GjfNh43EPDnl1P3TDBHI3hfvosn5VgY5f TXm0aiF8doIqyRWZoZTPz1GPbIIJcU08YSviSQsp0n7FcYOBgxay9Sfdod4QM6FKdWLI UF/MhFzgY3PTmqu/myXX8113rlDUA5bhabyAeOSKWiSeW4MzSsMmTTwwLec3MbxPiOy1 b1MQ== 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=WpG40KTHFMoLWjOweHt+dStqIgqIUJCmp8TPla7Mof7ubbOrTptArhWFMLq1rCL2O5 EF1LwsoefL+8n9Dfb2q/knJfnMSLbXmXnqMxspOUZp+7nD8qDbWGqcfaHBC0v0rkcF4M vVn+EKELIT69zxqi0I5Mtr2nj1TI7ukRSU0UlVANfyOG75zx+XaN+hw467DsRbHoTTP9 kQK3cJYKkmND2Ur2Gd3rr8wgo6nnErZBPbMrEwcYnMCykc8llj3+PV8N/P2Jv3UOaH6u Q2XomvrKHRuJS3IfGJXs1LRwJJRLwn1I58WUCLGD6dbKHWQ0p5tAIMjKyaoWomrE7Mfj t7AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mRWIvG0p; 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 o16si269495ejh.496.2021.07.26.09.10.36; Mon, 26 Jul 2021 09:10:59 -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=mRWIvG0p; 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 S237928AbhGZP0y (ORCPT + 99 others); Mon, 26 Jul 2021 11:26:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:53050 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237469AbhGZPPu (ORCPT ); Mon, 26 Jul 2021 11:15:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 277F360F02; Mon, 26 Jul 2021 15:56:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627314977; bh=dOyU/jTonwnSLfo73VTuw12SSwAoLPTF2ThdAbPs2q8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mRWIvG0p43+cXyjECGNr41MgvMu5q8wMWo/IIZBG6ftLXwTfek1pQurk4APz33bmf 9VALQR3GBEU30C1lMzs93UtO8AjSUp2ZI7KbUq5B5i71nhjZbGjgPYORags1q2HEAu /xwNY3oheTIqxj70bki0Zdng3QfKVyYVSW223P5A= 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.4 023/108] perf test session_topology: Delete session->evlist Date: Mon, 26 Jul 2021 17:38:24 +0200 Message-Id: <20210726153832.440848493@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 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