lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241013170732.71339-1-atrajeev@linux.vnet.ibm.com>
Date: Sun, 13 Oct 2024 22:37:32 +0530
From: Athira Rajeev <atrajeev@...ux.vnet.ibm.com>
To: acme@...nel.org, jolsa@...nel.org, adrian.hunter@...el.com,
        irogers@...gle.com, namhyung@...nel.org
Cc: linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
        linuxppc-dev@...ts.ozlabs.org, akanksha@...ux.ibm.com,
        maddy@...ux.ibm.com, atrajeev@...ux.vnet.ibm.com, kjain@...ux.ibm.com,
        disgoel@...ux.vnet.ibm.com, hbathini@...ux.ibm.com
Subject: [PATCH] tools/perf/tests: Remove duplicate evlist__delete in tests/tool_pmu.c

The testcase for tool_pmu failed in powerpc as below:

 ./perf test -v "Parsing without PMU name"
  8: Tool PMU                                                        :
  8.1: Parsing without PMU name                                      : FAILED!

This happens when parse_events results in either skip or fail
of an event. Because the code invokes evlist__delete(evlist)
and "goto out".

	ret = parse_events(evlist, str, &err);
	if (ret) {
		 evlist__delete(evlist);

But in the "out" section also evlist__delete happens.

	out:
        evlist__delete(evlist);
        return ret;

Hence remove the duplicate evlist__delete from the first path
in the testcase

With the change:
	# ./perf test -v "Parsing without PMU name"
	  8: Tool PMU                                                        :
	  8.1: Parsing without PMU name                                      : Ok

Signed-off-by: Athira Rajeev <atrajeev@...ux.vnet.ibm.com>
---
 tools/perf/tests/tool_pmu.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/perf/tests/tool_pmu.c b/tools/perf/tests/tool_pmu.c
index 94d0dd8fd3cb..618223654992 100644
--- a/tools/perf/tests/tool_pmu.c
+++ b/tools/perf/tests/tool_pmu.c
@@ -27,7 +27,6 @@ static int do_test(enum tool_pmu_event ev, bool with_pmu)
 	parse_events_error__init(&err);
 	ret = parse_events(evlist, str, &err);
 	if (ret) {
-		evlist__delete(evlist);
 		if (tool_pmu__skip_event(tool_pmu__event_to_str(ev))) {
 			ret = TEST_OK;
 			goto out;
-- 
2.27.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ