Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3673202pxv; Mon, 26 Jul 2021 09:08:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqfQFhIoSyjRotK9uegFHjJAYAXvxCRMdJqcm4GBVE+dyUfysvaUMLjq8gkMPABen9yzXq X-Received: by 2002:a6b:b795:: with SMTP id h143mr15469537iof.74.1627315720879; Mon, 26 Jul 2021 09:08:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627315720; cv=none; d=google.com; s=arc-20160816; b=qgsRhVoyyVgCwwODQLD43vwvWZ4DweR2PEkQlp9wstr0tJIhodiSmFYZpVLkX89Z6P WCO1N+o+da7QK6GseQgBJO4LbzX3IDNPapwoSkUnrplTL2iuNSYWUHiWtbICgC9Z3xeo ciBGWv6KnB7GDeKvurXSURCt5nrGodIkb5GVS4cWUcTbV72GSTo1g3LfikNKIyXuOi7d 04yszcGYZJED0m7xuDvBA+GzgZVvnKUcRpn4aE8UxLMj8GsxpwBUq2cpC/Uxy757UYX2 ArCZRaZL8QvtihUnaV3UhsRXlWHUs3UiyViKjb3nHTvCzbquJVQgKc8f5mhLOmgQ7d6A IgBQ== 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=pjpuiTZ7q+U0Gyjh6OYXUmLDuZP+HQOJy/UQiU8eNnM=; b=Dq8nGJIXNPFx9nT0EkAZH/4dgTngOUHGPGlunCfTRkL5JmJhioe1nEEZ7O7aZjmzZc fvwhBwEL1zmZbvjj1ZwHhBcJhIkMdtlUL3OFEBQra1MtzEuxSVPpj+Q7oKwp2FS6E+f+ jR9gitN766Y1la+azxC3HkCjS2Pn2JqCBp8KpP348OV/k8h6woghRI9Vc6s7A0sz/fV+ UIc0nx3YGUS47hp3SuegdX3diQlI4py4zh9gDZ5GUr7tknVcObvxAENCgN11/X5k7x5P 4D7twx0e9x1y0GCtS/IiKskfSTMfsoveFv5hdnzcztsI/J6YU7twhEmS98bFusB0mdB3 estg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iuhZ+cCp; 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 p20si301084ioo.40.2021.07.26.09.08.28; Mon, 26 Jul 2021 09:08:40 -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=iuhZ+cCp; 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 S238208AbhGZPZK (ORCPT + 99 others); Mon, 26 Jul 2021 11:25:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:55822 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237708AbhGZPQU (ORCPT ); Mon, 26 Jul 2021 11:16:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 644F160F57; Mon, 26 Jul 2021 15:56:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627315008; bh=LDVjFVNKxPvG52HZem17m9EAaJJT38vADrvYMk3+CtQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iuhZ+cCpe3kXwvobYMhTeOtbYsFDmQMwc/SzU1TBqxKAodynOSYhJwD/RXKE5/46x zcVxGjn6tfhB0ezOzgyRtcMw85Z2XbFfed4o/sA5i7LTdzGEZ6FieJsLEBR9DN0D8C 9KRTfkKp65t8OGW2OyPAhGhxHMXyzIPzciAeuEWM= 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 024/108] perf test event_update: Fix memory leak of evlist Date: Mon, 26 Jul 2021 17:38:25 +0200 Message-Id: <20210726153832.479714266@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 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 c727379cf20e..195b29797acc 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