mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	David Ahern <dsahern@gmail.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Namhyung Kim <namhyung.kim@lge.com>,
	Stephane Eranian <eranian@google.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tools: perf: util: session.c:  Cleaning up inconsistent NULL checks
Date: Fri, 23 May 2014 09:05:34 +0200	[thread overview]
Message-ID: <20140523070534.GB1074@krava> (raw)
In-Reply-To: <1400795916-12613-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

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@spectrumdigital.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@gmail.com>
Date:   Thu May 15 02:13:38 2014 +0900


thanks,
jirka

  reply	other threads:[~2014-05-23  7:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-22 21:58 Rickard Strandqvist
2014-05-23  7:05 ` Jiri Olsa [this message]
2014-05-23 16:47   ` Rickard Strandqvist

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140523070534.GB1074@krava \
    --to=jolsa@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=dsahern@gmail.com \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung.kim@lge.com \
    --cc=paulus@samba.org \
    --cc=rickard_strandqvist@spectrumdigital.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome