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  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]
Date:	Thu, 22 May 2014 23:58:36 +0200
From:	Rickard Strandqvist <>
To:	Peter Zijlstra <>,
	Paul Mackerras <>
Cc:	Rickard Strandqvist <>,
	Ingo Molnar <>,
	Arnaldo Carvalho de Melo <>,
	David Ahern <>, Jiri Olsa <>,
	Adrian Hunter <>,
	Namhyung Kim <>,
	Stephane Eranian <>,
Subject: [PATCH] tools: perf: util: session.c:  Cleaning up inconsistent NULL checks

Cleaning up inconsistent NULL checks.
There is otherwise a risk of a possible null pointer dereference.

Was largely found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <>
 tools/perf/util/session.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 55960f2..8defd80 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1625,13 +1625,15 @@ out_delete_map:
 void perf_session__fprintf_info(struct perf_session *session, FILE *fp,
 				bool full)
-	int fd = perf_data_file__fd(session->file);
+	int fd;
 	struct stat st;
 	int ret;
 	if (session == NULL || fp == NULL)
+	fd = perf_data_file__fd(session->file);
 	ret = fstat(fd, &st);
 	if (ret == -1)

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists