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-prev] [day] [month] [year] [list]
Date:   Thu, 12 Oct 2023 14:53:28 +0800
From:   "Kunwu.Chan" <chentao@...inos.cn>
To:     adrian.hunter@...el.com
Cc:     acme@...nel.org, alexander.shishkin@...ux.intel.com,
        chentao@...inos.cn, irogers@...gle.com, jolsa@...nel.org,
        kan.liang@...ux.intel.com, kprateek.nayak@....com,
        kunwu.chan@...mail.com, linux-kernel@...r.kernel.org,
        linux-perf-users@...r.kernel.org, mark.rutland@....com,
        mingo@...hat.com, namhyung@...nel.org, peterz@...radead.org,
        robert.richter@....com, seanjc@...gle.com
Subject: [PATCH v2] perf tools: Put the function return operation at the end of the function

All error paths go to the Release events process, while under normal
circumstances, go directly to the out process.

Fixes: 4e1b9c679fcb ("perf tools: Refactor print_event_desc()")
Signed-off-by: Kunwu.Chan <chentao@...inos.cn>
---
 tools/perf/util/header.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index d812e1e371a7..c2f23381a9c6 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -1998,13 +1998,14 @@ static struct evsel *read_event_desc(struct feat_fd *ff)
 			id++;
 		}
 	}
-out:
-	free(buf);
-	return events;
+goto out;
 error:
 	free_event_desc(events);
 	events = NULL;
-	goto out;
+
+out:
+	free(buf);
+	return events;
 }
 
 static int __desc_attr__fprintf(FILE *fp, const char *name, const char *val,
-- 
2.25.1

Sorry, the wrong patch was sent. The correct patch should be v2 as follows.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ