Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3745361pxv; Mon, 26 Jul 2021 10:51:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznLV0KihCBZCuOEvc+1AiN4MiHaRpZqYQejI3Q/dN337MAjhZanLE9hZou1bizIVK677Wp X-Received: by 2002:a17:907:7895:: with SMTP id ku21mr4708833ejc.265.1627321916261; Mon, 26 Jul 2021 10:51:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627321916; cv=none; d=google.com; s=arc-20160816; b=elZALV+yXaeHgYNzMp18+CsQXudEdfT0fBR5ilJ4TWGRlqi8AsXyHGOe6si+1Ct8mH BHVav6zUXEdI2ga2hSRuunck9u3Knl7GCqOJ36FMlt+H412kB7adiEkV4DlcxY88OKGw 0XufpQxtdJ5GOaJX5aFpcX2JEYUFEgzX5hGO5z/PjSIPkTwF/ndrrtlURx/HhfsizsEk DL3edDVppf6R7zo9VTHqSRlTEy505wF/63UB+BkSVyaN36/oeOOZGG1Ty4ZD/VaQ50Mf Tbgi+LBanXTL4P1ctHiqiytxE1A/ErUpNYZG9F09U0IsPXpwIKGztpx0/xixcn2X7b12 l2nw== 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=PTLbCBZexQaaQRc1rH3l5EeTY8wG1jzOyJWl0g0Y+gw=; b=tyDwBkTZSSZBaTD0dxkG9gyvas63xNjPmF3Ci4EwkcNy51AWd85aREL4VMYsAhycdl P1YuOyAWR3tFJmhRQzrIHuuMNW8l7S94Z8s2SeLdgjfetfJGZhuVzg30gGdMcwVJwhsU TigZowkVafDJaEDCof9g3iau+69YtssCMXaXh3dXe09NVmAZs+0QDhOckEWoc8TvSYL/ 1p75QsMxGM46bRvm3ZSQff8XSOsJGe+fMF50YJ3fCWhu7MoXmAT8lkiwEaqVyAbzdsfO /Zmj1JYlq9y/2yzCS4bB484OvhHouonbqx3LIdvQp1LSTdMMXOV0FinEO74EK6WDeM5r FFOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1Qr+q3B6; 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 v7si520167ejo.317.2021.07.26.10.51.32; Mon, 26 Jul 2021 10:51:56 -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=1Qr+q3B6; 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 S238411AbhGZPjj (ORCPT + 99 others); Mon, 26 Jul 2021 11:39:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:37148 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237329AbhGZPW2 (ORCPT ); Mon, 26 Jul 2021 11:22:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7A14D60E09; Mon, 26 Jul 2021 16:02:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627315377; bh=/yzQmVErl1HY6Ct8foV+D5Df/ghR0Ctmt50hyioTeLU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1Qr+q3B62iHHrZDq/84tiQcWnhJUc4eWZH56/zoA/YCrfNoTknhZ69fDejOhAVKtc uaowEX5LP1Rz8H8hHdaA/ljmYmskTfG5vvhixUf8R+H52MaEorcmIGJVB7GgEpjMCs nsGb2vwxYZUPAU6045/8MsUFK9nwP/Hhm5sYAtxA= 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 038/167] perf test event_update: Fix memory leak of evlist Date: Mon, 26 Jul 2021 17:37:51 +0200 Message-Id: <20210726153840.666182126@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 fc56f54f6fcd5337634f4545af6459613129b432 ] ASan reports a memory leak when running: # perf test "49: Synthesize attr update" Caused by evlist not being deleted. This patch adds the missing evlist__delete and removes the perf_cpu_map__put since it's already being deleted by evlist__delete. Signed-off-by: Riccardo Mancini Fixes: a6e5281780d1da65 ("perf tools: Add event_update event unit type") Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/f7994ad63d248f7645f901132d208fadf9f2b7e4.1626343282.git.rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/tests/event_update.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/tests/event_update.c b/tools/perf/tests/event_update.c index bdcf032f8516..1c9a6138fba1 100644 --- a/tools/perf/tests/event_update.c +++ b/tools/perf/tests/event_update.c @@ -119,6 +119,6 @@ int test__event_update(struct test *test __maybe_unused, int subtest __maybe_unu TEST_ASSERT_VAL("failed to synthesize attr update cpus", !perf_event__synthesize_event_update_cpus(&tmp.tool, evsel, process_event_cpus)); - perf_cpu_map__put(evsel->core.own_cpus); + evlist__delete(evlist); return 0; } -- 2.30.2