All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] perf tools: Fix potential memory leak in perf events parser
@ 2020-06-11 13:17 Markus Elfring
  2020-06-11 14:13 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Markus Elfring @ 2020-06-11 13:17 UTC (permalink / raw)
  To: Chen Wandun, netdev, bpf
  Cc: linux-kernel, Yonghong Song, Song Liu, Peter Zijlstra,
	Adrian Hunter, Alexander Shishkin, Andrii Nakryiko,
	Arnaldo Carvalho de Melo, Cheng Jian, Daniel Borkmann,
	Ian Rogers, Ingo Molnar, Jiri Olsa, John Fastabend, Leo Yan,
	Mark Rutland, Martin KaFai Lau, Namhyung Kim

> Fix potential memory leak in function parse_events_term__sym_hw()
> and parse_events_term__clone().

Would you like to add the tag “Fixes” to the commit message?


…
> +++ b/tools/perf/util/parse-events.c
> @@ -2957,9 +2958,20 @@  int parse_events_term__sym_hw(struct parse_events_term **term,
>  	sym = &event_symbols_hw[idx];
>
>  	str = strdup(sym->symbol);
> -	if (!str)
> +	if (!str) {
> +		if (!config)
> +			free(temp.config);
>  		return -ENOMEM;
> -	return new_term(term, &temp, str, 0);
> +	}
> +
> +	ret = new_term(term, &temp, str, 0);
> +	if (ret < 0) {
> +		free(str);
> +		if (!config)
> +			free(temp.config);
> +	}
> +
> +	return ret;
>  }
…

How do you think about to add jump targets for a bit of
common exception handling code in these function implementations?

Regards,
Markus

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] perf tools: Fix potential memory leak in perf events parser
  2020-06-11 13:17 [PATCH] perf tools: Fix potential memory leak in perf events parser Markus Elfring
@ 2020-06-11 14:13 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2020-06-11 14:13 UTC (permalink / raw)
  To: Markus Elfring
  Cc: Chen Wandun, netdev, bpf, linux-kernel, Yonghong Song, Song Liu,
	Peter Zijlstra, Adrian Hunter, Alexander Shishkin,
	Andrii Nakryiko, Arnaldo Carvalho de Melo, Cheng Jian,
	Daniel Borkmann, Ian Rogers, Ingo Molnar, Jiri Olsa,
	John Fastabend, Leo Yan, Mark Rutland, Martin KaFai Lau,
	Namhyung Kim

On Thu, Jun 11, 2020 at 03:17:17PM +0200, Markus Elfring wrote:
> > Fix potential memory leak in function parse_events_term__sym_hw()
> > and parse_events_term__clone().
> 
> Would you like to add the tag “Fixes” to the commit message?
> 
> 
> …
> > +++ b/tools/perf/util/parse-events.c
> …
> > @@ -2957,9 +2958,20 @@  int parse_events_term__sym_hw(struct parse_events_term **term,
> >  	sym = &event_symbols_hw[idx];
> >
> >  	str = strdup(sym->symbol);
> > -	if (!str)
> > +	if (!str) {
> > +		if (!config)
> > +			free(temp.config);
> >  		return -ENOMEM;
> > -	return new_term(term, &temp, str, 0);
> > +	}
> > +
> > +	ret = new_term(term, &temp, str, 0);
> > +	if (ret < 0) {
> > +		free(str);
> > +		if (!config)
> > +			free(temp.config);
> > +	}
> > +
> > +	return ret;
> >  }
> …
> 
> How do you think about to add jump targets for a bit of
> common exception handling code in these function implementations?


Hi,

This is the semi-friendly patch-bot of Greg Kroah-Hartman.

Markus, you seem to have sent a nonsensical or otherwise pointless
review comment to a patch submission on a Linux kernel developer mailing
list.  I strongly suggest that you not do this anymore.  Please do not
bother developers who are actively working to produce patches and
features with comments that, in the end, are a waste of time.

Patch submitter, please ignore Markus's suggestion; you do not need to
follow it at all.  The person/bot/AI that sent it is being ignored by
almost all Linux kernel maintainers for having a persistent pattern of
behavior of producing distracting and pointless commentary, and
inability to adapt to feedback.  Please feel free to also ignore emails
from them.

thanks,

greg k-h's patch email bot

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-11 14:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-11 13:17 [PATCH] perf tools: Fix potential memory leak in perf events parser Markus Elfring
2020-06-11 14:13 ` Greg KH

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.