linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Sohaib Mohamed <sohaib.amhmd@gmail.com>
Cc: irogers@google.com, Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
	Pierre Gondois <Pierre.Gondois@arm.com>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] perf bench: Fix memory leaks.
Date: Wed, 17 Nov 2021 12:25:20 -0300	[thread overview]
Message-ID: <YZUe4C7laP5BkMmu@kernel.org> (raw)
In-Reply-To: <20211110022012.16620-1-sohaib.amhmd@gmail.com>

Em Wed, Nov 10, 2021 at 04:20:11AM +0200, Sohaib Mohamed escreveu:
> ASan reports memory leaks while running:
> $ perf bench sched all
> 
> Fixes: e27454cc6352 ("perf bench: Add sched-messaging.c: Benchmark for
> scheduler and IPC mechanisms based on hackbench")

Thanks, applied.

- Arnaldo

 
> Signed-off-by: Sohaib Mohamed <sohaib.amhmd@gmail.com>
> Acked-by: Ian Rogers <irogers@google.com>
> ---
>  tools/perf/bench/sched-messaging.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/tools/perf/bench/sched-messaging.c b/tools/perf/bench/sched-messaging.c
> index 488f6e6ba1a5..fa0ff4ce2b74 100644
> --- a/tools/perf/bench/sched-messaging.c
> +++ b/tools/perf/bench/sched-messaging.c
> @@ -223,6 +223,8 @@ static unsigned int group(pthread_t *pth,
>  		snd_ctx->out_fds[i] = fds[1];
>  		if (!thread_mode)
>  			close(fds[0]);
> +
> +		free(ctx);
>  	}
> 
>  	/* Now we have all the fds, fork the senders */
> @@ -239,6 +241,8 @@ static unsigned int group(pthread_t *pth,
>  		for (i = 0; i < num_fds; i++)
>  			close(snd_ctx->out_fds[i]);
> 
> +	free(snd_ctx);
> +
>  	/* Return number of children to reap */
>  	return num_fds * 2;
>  }
> --
> 2.25.1

-- 

- Arnaldo

      reply	other threads:[~2021-11-17 15:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-10  2:20 [PATCH v2] perf bench: Fix memory leaks Sohaib Mohamed
2021-11-17 15:25 ` 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=YZUe4C7laP5BkMmu@kernel.org \
    --to=acme@kernel.org \
    --cc=Pierre.Gondois@arm.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=mitake@dcl.info.waseda.ac.jp \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rusty@rustcorp.com.au \
    --cc=sohaib.amhmd@gmail.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).