Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1260364ybp; Fri, 11 Oct 2019 11:22:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqywulfXR2SmNXEzoixkSgyepuPAHgS3fmv8LIKgfzbxj5etCa24+oS/YuRBD/DPrfQvTqZN X-Received: by 2002:a17:906:6d08:: with SMTP id m8mr15143555ejr.150.1570818156171; Fri, 11 Oct 2019 11:22:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570818156; cv=none; d=google.com; s=arc-20160816; b=iVPcE8ssc+QFiBkcWZxU6UoQ+w2PUFVDRczFMiOxqvPzxtI4PQ2YksNSdMMF6ku31H sFJQJA7KsEvAMbpJc4YnYrK4xOMgZAeV9E3wqC1TGBWGjSoqg59KcGx2RmSEMuNK1aOP Beum586TdicYO9/zaBSOn5DpC+cqY2q5Lm4NPLGeFYOD1voUbZZCQhqYDlKHf1DfYzS7 KYt9f2eNi5EMzPjtM0B02uJ8uSJ/YhpFkFRgD+VZ6bEVFYBUk9iTogcjr7hKHLwaotYk dItXVAKdsyNdxmDO9aFdwuF/XueLR73nUIzeyhrcw+dcWi8TIISOZbbYSIuEoiNYnLPS DAOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=MRvYs9Wih2EEvN3dfMxZktLg9MEiEPFKC435RDHly6s=; b=yRGBGV2HZ/dhAFmfLV7gY/qmhDulI1jyFYSyeH4DiGQjyrTBE1/4obNcz50sceZb2M MiMHUE4ymD1XoSdornbqrxbQRTb/SRgMTwEWIuilERo28X0n9D8SrYXgkylAsAHMW7z3 fZSUK/H+6ZMADcU5JTE25Z1OV/RPmNyX7AWcWkw3tUTh5DErq8d6jYUlB7GIU8TsFjW0 0mVkgwMJXF4PD+6qTxjG1Y+CR0kW7cxidGwkWaaYfZhzLmI2vZ0IeG1MihEcx6qWyqiK 82mtfh5mo1gTLyfi7Rh5mdzGkKZM5UvH18EuiuQOJjZz25IR2hWx+iqLgL1bz5wQNRPU 1Gzg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q46si6751354eda.44.2019.10.11.11.22.13; Fri, 11 Oct 2019 11:22:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728821AbfJKSVn (ORCPT + 99 others); Fri, 11 Oct 2019 14:21:43 -0400 Received: from mga12.intel.com ([192.55.52.136]:23224 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728470AbfJKSVn (ORCPT ); Fri, 11 Oct 2019 14:21:43 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Oct 2019 11:21:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,285,1566889200"; d="scan'208";a="198776959" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.137]) by orsmga006.jf.intel.com with ESMTP; 11 Oct 2019 11:21:42 -0700 Received: by tassilo.localdomain (Postfix, from userid 1000) id 73B6B3000EF; Fri, 11 Oct 2019 11:21:42 -0700 (PDT) From: Andi Kleen To: acme@kernel.org Cc: jolsa@kernel.org, linux-kernel@vger.kernel.org, Andi Kleen Subject: [PATCH 2/2] perf evlist: Fix fix for freed id arrays Date: Fri, 11 Oct 2019 11:21:40 -0700 Message-Id: <20191011182140.8353-2-andi@firstfloor.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191011182140.8353-1-andi@firstfloor.org> References: <20191011182140.8353-1-andi@firstfloor.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andi Kleen In the earlier fix for the memory overrun of id arrays I managed to typo the wrong event in the fix. Of course we need to close the current event in the loop, not the original failing event. The same test case as in the original patch still passes. Fixes: 7834fa948beb ("perf evlist: Fix access of freed id arrays") Signed-off-by: Andi Kleen --- tools/perf/util/evlist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index e33b46aca5cb..2f8ac60af76b 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -1728,7 +1728,7 @@ struct evsel *perf_evlist__reset_weak_group(struct evlist *evsel_list, is_open = false; if (c2->leader == leader) { if (is_open) - perf_evsel__close(&evsel->core); + perf_evsel__close(&c2->core); c2->leader = c2; c2->core.nr_members = 0; } -- 2.21.0