[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140523070534.GB1074@krava>
Date: Fri, 23 May 2014 09:05:34 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Paul Mackerras <paulus@...ba.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
David Ahern <dsahern@...il.com>,
Adrian Hunter <adrian.hunter@...el.com>,
Namhyung Kim <namhyung.kim@....com>,
Stephane Eranian <eranian@...gle.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] tools: perf: util: session.c: Cleaning up inconsistent
NULL checks
On Thu, May 22, 2014 at 11:58:36PM +0200, Rickard Strandqvist wrote:
> 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 <rickard_strandqvist@...ctrumdigital.se>
> ---
> 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)
> return;
>
> + fd = perf_data_file__fd(session->file);
> +
> ret = fstat(fd, &st);
> if (ret == -1)
> return;
> --
> 1.7.10.4
>
hi,
I merged same patch just a week ago or so ;-)
perf session: Fix possible null pointer dereference in session.c
commit c5765ece8a050836c6255e1276fc8e0e867078da
Author: Masanari Iida <standby24x7@...il.com>
Date: Thu May 15 02:13:38 2014 +0900
thanks,
jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists