From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966111AbbLRIre (ORCPT ); Fri, 18 Dec 2015 03:47:34 -0500 Received: from terminus.zytor.com ([198.137.202.10]:51774 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965428AbbLRIrc (ORCPT ); Fri, 18 Dec 2015 03:47:32 -0500 Date: Fri, 18 Dec 2015 00:47:13 -0800 From: tip-bot for Namhyung Kim Message-ID: Cc: linux-kernel@vger.kernel.org, namhyung@kernel.org, hpa@zytor.com, a.p.zijlstra@chello.nl, adrian.hunter@intel.com, mingo@kernel.org, jolsa@kernel.org, dsahern@gmail.com, tglx@linutronix.de, acme@redhat.com Reply-To: dsahern@gmail.com, jolsa@kernel.org, adrian.hunter@intel.com, mingo@kernel.org, a.p.zijlstra@chello.nl, tglx@linutronix.de, acme@redhat.com, namhyung@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com In-Reply-To: <1450062673-22312-1-git-send-email-namhyung@kernel.org> References: <1450062673-22312-1-git-send-email-namhyung@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf test: Fix hist testcases when kptr_restrict is on Git-Commit-ID: 71d6de64feddd4b455555326fba2111b3006d9e0 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 71d6de64feddd4b455555326fba2111b3006d9e0 Gitweb: http://git.kernel.org/tip/71d6de64feddd4b455555326fba2111b3006d9e0 Author: Namhyung Kim AuthorDate: Mon, 14 Dec 2015 12:11:13 +0900 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 14 Dec 2015 12:15:07 -0300 perf test: Fix hist testcases when kptr_restrict is on Currently if kptr_restrict is enabled, all hist tests failed with segfaults. This is because machine__create_kernel_maps() in setup_fake_machine() failed in that situation, and it called machine__delete() on the error path. But outer callers again called machines__exit() causing double free for the host machine. Signed-off-by: Namhyung Kim Cc: Jiri Olsa Cc: Adrian Hunter Cc: David Ahern Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1450062673-22312-1-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/tests/hists_common.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/perf/tests/hists_common.c b/tools/perf/tests/hists_common.c index 46f453b..bcfd081 100644 --- a/tools/perf/tests/hists_common.c +++ b/tools/perf/tests/hists_common.c @@ -88,8 +88,8 @@ struct machine *setup_fake_machine(struct machines *machines) } if (machine__create_kernel_maps(machine)) { - pr_debug("Not enough memory for machine setup\n"); - goto out; + pr_debug("Cannot create kernel maps\n"); + return NULL; } for (i = 0; i < ARRAY_SIZE(fake_threads); i++) { @@ -155,7 +155,6 @@ struct machine *setup_fake_machine(struct machines *machines) out: pr_debug("Not enough memory for machine setup\n"); machine__delete_threads(machine); - machine__delete(machine); return NULL; }