Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3743767pxv; Mon, 26 Jul 2021 10:49:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzs04pDjQKfYrAFI5tSOtSOGNR8PETWG4pVX07HJbx6UoJdNQafHfgonI7zxQs2Q4hwDJa0 X-Received: by 2002:a17:906:aed3:: with SMTP id me19mr5536611ejb.187.1627321740756; Mon, 26 Jul 2021 10:49:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627321740; cv=none; d=google.com; s=arc-20160816; b=afvNxFX+HaSbUWAsvnrWRERtQhJL8Zaz7XCiSsDSl1gQYSfeUY1eddjSfau+1Sn4uX Dtx9wi7PXZDWlM3Hq0XdK878p0L8gL5en6ZpU2RUA5lVWHaiUEijkLA2LeCz4iKnAFCi GC2ovJfWimImeZSW6NxmHgytQUXg9Ep6v7cfd42D0szY6oKJ01uF2Ci290yVrfgBDgJD D06lpeCP7oPcuNzbvUxtMNNBsyveeq0+qAMRV7QnsEGXLTv7Aqvvz3Zh6jLNalSXzlTI qdI9jdXBmvqA60gkBxV7kMTFJxDXsk/bZIMptZeUyE26JlEtlb/jQXy0YOQM/UB3J5yN 7H5w== 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=oP0QPXS1mQnE9SjBkU2IXePhTG1KuzmxNjY6NzC5tYM=; b=d8JXFHv49n4ZNY5CRHP7SMC96z5zav5i+3e/M0bUTyo9DuAUKsF8CXcY1OuApaT4bT h0mEra7zzuxXoEZvDAoetfxLHNdJWx5JzQ+ZewTWCWFlxeL6gfx4gkFpr16l30fYChg6 DzGEw8ageS9Vn8jkQ8AGiod/rR/1EBTu+/NOPjwi9VTYV1R1bNnxtpDo2KedZBGx3zqB fnd99L2BrBE3bln9wcpygqVJGhqzncmnq+2X/kGGgomRfkScpVFizDv/5lYXAt9dyXDa nmYZvm+1HFRcXBzVhLUKMga2oFb8h6LtikegNpzWoN9CnOQCF56a3PyZtZDuu3EHbZD6 o7jQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ud5XbpIb; 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 dn25si540142edb.332.2021.07.26.10.48.36; Mon, 26 Jul 2021 10:49:00 -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=Ud5XbpIb; 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 S234297AbhGZPgf (ORCPT + 99 others); Mon, 26 Jul 2021 11:36:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:35022 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237108AbhGZPVE (ORCPT ); Mon, 26 Jul 2021 11:21:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4AFC860F38; Mon, 26 Jul 2021 16:01:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627315292; bh=AEcizyHU+/c5oQ14TgiR8P1PpRbnAJdqQA5p4hEGReA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ud5XbpIbziaxaNeip5ATXcg02EcUGkocsrm4WCgb1M+Z8+BMIN/Y0CIKfh4o9CwfM ePVPI55KBLhObYhx2Ga51QSbtcEPnej+1AZhpdZFNKKKzoNTc94c1q68gipsbFqT62 YGFamUOPyx82HcHD4rqjqbt4hGcMFBBMKkxLF9f8= 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 040/167] perf test maps__merge_in: Fix memory leak of maps Date: Mon, 26 Jul 2021 17:37:53 +0200 Message-Id: <20210726153840.736590102@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 244d1797c8c8e850b8de7992af713aa5c70d5650 ] ASan reports a memory leak when running: # perf test "65: maps__merge_in" This is the second and final patch addressing these memory leaks. This time, the problem is simply that the maps object is never destructed. This patch adds the missing maps__exit call. Signed-off-by: Riccardo Mancini Fixes: 79b6bb73f888933c ("perf maps: Merge 'struct maps' with 'struct map_groups'") Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/a1a29b97a58738987d150e94d4ebfad0282fb038.1626343282.git.rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/tests/maps.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/perf/tests/maps.c b/tools/perf/tests/maps.c index edcbc70ff9d6..1ac72919fa35 100644 --- a/tools/perf/tests/maps.c +++ b/tools/perf/tests/maps.c @@ -116,5 +116,7 @@ int test__maps__merge_in(struct test *t __maybe_unused, int subtest __maybe_unus ret = check_maps(merged3, ARRAY_SIZE(merged3), &maps); TEST_ASSERT_VAL("merge check failed", !ret); + + maps__exit(&maps); return TEST_OK; } -- 2.30.2