All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
To: Jiri Olsa <jolsa@redhat.com>
Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Namhyung Kim <namhyung@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf annotate: Fix multiple memory and file descriptor leaks
Date: Tue, 15 Oct 2019 12:02:11 -0300	[thread overview]
Message-ID: <20191015150211.GA25820@kernel.org> (raw)
In-Reply-To: <20191015084632.GC10951@krava>

Em Tue, Oct 15, 2019 at 10:46:32AM +0200, Jiri Olsa escreveu:
> On Mon, Oct 14, 2019 at 12:10:47PM -0500, Gustavo A. R. Silva wrote:
> > Store SYMBOL_ANNOTATE_ERRNO__BPF_MISSING_BTF in variable *ret*, instead
> > of returning in the middle of the function and leaking multiple
> > resources: prog_linfo, btf, s and bfdf.
> > 
> > Addresses-Coverity-ID: 1454832 ("Structurally dead code")
> > Fixes: 11aad897f6d1 ("perf annotate: Don't return -1 for error when doing BPF disassembly")
> > Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> 
> Acked-by: Jiri Olsa <jolsa@kernel.org>
> 
> thanks,
> jirka
> 
> > ---
> >  tools/perf/util/annotate.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
> > index 4036c7f7b0fb..e42bf572358c 100644
> > --- a/tools/perf/util/annotate.c
> > +++ b/tools/perf/util/annotate.c
> > @@ -1758,7 +1758,7 @@ static int symbol__disassemble_bpf(struct symbol *sym,
> >  	info_node = perf_env__find_bpf_prog_info(dso->bpf_prog.env,
> >  						 dso->bpf_prog.id);
> >  	if (!info_node) {
> > -		return SYMBOL_ANNOTATE_ERRNO__BPF_MISSING_BTF;
> > +		ret = SYMBOL_ANNOTATE_ERRNO__BPF_MISSING_BTF;
> >  		goto out;

Ouch, unreachable goto, /me ducks

- Arnaldo

> >  	}
> >  	info_linear = info_node->info_linear;
> > -- 
> > 2.23.0
> > 

-- 

- Arnaldo

  reply	other threads:[~2019-10-15 15:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-14 17:10 [PATCH] perf annotate: Fix multiple memory and file descriptor leaks Gustavo A. R. Silva
2019-10-15  8:46 ` Jiri Olsa
2019-10-15 15:02   ` Arnaldo Carvalho de Melo [this message]
2019-10-21  6:26 ` [tip: perf/urgent] " tip-bot2 for Gustavo A. R. Silva

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=20191015150211.GA25820@kernel.org \
    --to=arnaldo.melo@gmail.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=gustavo@embeddedor.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.