linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Yang Jihong <yangjihong1@huawei.com>
Cc: peterz@infradead.org, mingo@redhat.com, mark.rutland@arm.com,
	alexander.shishkin@linux.intel.com, jolsa@kernel.org,
	namhyung@kernel.org, irogers@google.com, adrian.hunter@intel.com,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf tracepoint: Fix memory leak in is_valid_tracepoint()
Date: Fri, 28 Apr 2023 22:59:12 -0300	[thread overview]
Message-ID: <ZEx58HsdECf42Qce@kernel.org> (raw)
In-Reply-To: <20230421025953.173826-1-yangjihong1@huawei.com>

Em Fri, Apr 21, 2023 at 02:59:53AM +0000, Yang Jihong escreveu:
> When is_valid_tracepoint() returns 1, need to call put_events_file() to
> free `dir_path`.
> 
> Fixes: 25a7d914274d ("perf parse-events: Use get/put_events_file()")
> Signed-off-by: Yang Jihong <yangjihong1@huawei.com>

Thanks, applied.

- Arnaldo

> ---
>  tools/perf/util/tracepoint.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/perf/util/tracepoint.c b/tools/perf/util/tracepoint.c
> index 89ef56c43311..92dd8b455b90 100644
> --- a/tools/perf/util/tracepoint.c
> +++ b/tools/perf/util/tracepoint.c
> @@ -50,6 +50,7 @@ int is_valid_tracepoint(const char *event_string)
>  				 sys_dirent->d_name, evt_dirent->d_name);
>  			if (!strcmp(evt_path, event_string)) {
>  				closedir(evt_dir);
> +				put_events_file(dir_path);
>  				closedir(sys_dir);
>  				return 1;
>  			}
> -- 
> 2.30.GIT
> 

-- 

- Arnaldo

      reply	other threads:[~2023-04-29  1:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-21  2:59 [PATCH] perf tracepoint: Fix memory leak in is_valid_tracepoint() Yang Jihong
2023-04-29  1:59 ` Arnaldo Carvalho de Melo [this message]

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=ZEx58HsdECf42Qce@kernel.org \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=yangjihong1@huawei.com \
    /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;
as well as URLs for NNTP newsgroup(s).