Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp873857pxk; Thu, 17 Sep 2020 19:57:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxoHrvjubFqM50YdgWHThJe5eriwWufqbvlvSkSAR+TcOFrXN/dPhqIWLBBAqiu/cNjneD1 X-Received: by 2002:a17:906:194b:: with SMTP id b11mr33256121eje.159.1600397854189; Thu, 17 Sep 2020 19:57:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600397854; cv=none; d=google.com; s=arc-20160816; b=m7mm2uXtQ34Z0PKmbYjgxglplg4zeLScWVx94EBwXrqW0riKX+aFWD+MlAulQd53sF JdlC0Jz/vFULyTkG+4pLxhno/COwh0+glpEvPv7RGSp8Jg6u4W4SfI4TT2vYcI2Ydwkk 7B5a6JZw+fedhJ134Ohcw0rpxqJi7z9gTLXUFpkuZDcIFSIPYa69cfSa3c61iujIhrUj G8S7dzxgy3mHnU7K/lam3vAIt/QfeHEBlZluEWe/xQCq20BpSSeLeNO5FPpGXlkidL7m a9XW3LdYEl4wPdlJeSkOOmyUiObxovxgO/60TIG07qjMI0n64hTzRu2jxxpDG9Oj5xGW Bdyw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=hHGulFn/IbJM5SFmh37EY470MANxzeCnjAvDRn/vQlE=; b=dPdKfUbLD5QPJ+CFByaa85RRjjYKrrezc2o4kkeDG2gNx1Ztz3XYnE5fpl/S0XSaKr HQXrYKEa402YCZgjAbkQvHlT7/5mYZxBcjGumP/9X0oklNEoTwELxoBTPYzJZmrpbwzD HZ2WOUUnslgrPKEhM5ImMCeZnpYL8ASSHcMxaW36Iaa4jx7jY7sQP3TliECu+ZrBRfwg 2e8aaTK3DGjmQRXKQOcuA+Mr/zzXRUXhgRG++8szV1sK+RbySHQpGU3m/juEo2QgiZkr xmvApcJ978PWZ0jhvzd6qi1u+H9sX++P6Dr0tN5Ig/YDA6w+YLeAJeHaoK6kuPr4yYMF 9YHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ekjKictk; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dg23si1182187edb.229.2020.09.17.19.57.11; Thu, 17 Sep 2020 19:57:34 -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=@kernel.org header.s=default header.b=ekjKictk; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728607AbgIRCzT (ORCPT + 99 others); Thu, 17 Sep 2020 22:55:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:57250 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727861AbgIRCHJ (ORCPT ); Thu, 17 Sep 2020 22:07:09 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 881E623888; Fri, 18 Sep 2020 02:07:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394828; bh=6XU8vPkSLEwOa1GUgEOWTxPjC+wNJ5n4jec0uDYGkig=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ekjKictkpoTkboZo996yLByJxagU2d6HgXaSQ2c6WwG75URHdmTuohjlRfZn5u4Y0 1ut/zXmDcyaxTF39vHOtJfMqW2Jni/Nvdka0gDt0Ewws2vjbGaJj1vj4sO0PVsMHin FZbGjhq4/qcuED2UkiutNkpY9RtveP7vqteuBPco= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ian Rogers , Andi Kleen , Adrian Hunter , Alexander Shishkin , Jiri Olsa , Mark Rutland , Namhyung Kim , Peter Zijlstra , Stephane Eranian , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH AUTOSEL 5.4 292/330] perf evsel: Fix 2 memory leaks Date: Thu, 17 Sep 2020 22:00:32 -0400 Message-Id: <20200918020110.2063155-292-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020110.2063155-1-sashal@kernel.org> References: <20200918020110.2063155-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ian Rogers [ Upstream commit 3efc899d9afb3d03604f191a0be9669eabbfc4aa ] If allocated, perf_pkg_mask and metric_events need freeing. Signed-off-by: Ian Rogers Reviewed-by: Andi Kleen Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20200512235918.10732-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/util/evsel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 12b1755b136d3..9dd9e3f4ef591 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -1255,6 +1255,8 @@ void perf_evsel__exit(struct evsel *evsel) zfree(&evsel->group_name); zfree(&evsel->name); zfree(&evsel->pmu_name); + zfree(&evsel->per_pkg_mask); + zfree(&evsel->metric_events); perf_evsel__object.fini(evsel); } -- 2.25.1