From: Namhyung Kim <namhyung@kernel.org>
To: lirongqing <lirongqing@baidu.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
James Clark <james.clark@linaro.org>,
Alexander Antonov <alexander.antonov@linux.intel.com>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf iostat: Release the port list if command allocation fails
Date: Sun, 8 Nov 2026 21:05:15 -0800 [thread overview]
Message-ID: <avFUi_R0dzVEaT2X@z2> (raw)
In-Reply-To: <20261106021840.2186-1-lirongqing@baidu.com>
Hello,
On Fri, Nov 06, 2026 at 10:18:40AM +0800, lirongqing wrote:
> From: Li RongQing <lirongqing@baidu.com>
>
> The event-group builder takes ownership of the root port list and frees
> it on its normal and parsing-error paths. If allocation of the event
> command fails, however, it returns directly without releasing the list,
> its pointer array or its ports.
>
> Use the existing cleanup path for this allocation failure too, before
> any port has been transferred to an event.
>
> Found while testing the iostat fixes with allocation fault injection.
>
> Fixes: f9ed693e8bc0 ("perf stat: Enable iostat mode for x86 platforms")
> Signed-off-by: Li RongQing <lirongqing@baidu.com>
This patch doesn't apply. Can you please rebase onto the current
perf-tools-next?
Thanks,
Namhyung
> ---
> tools/perf/arch/x86/util/iostat.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/arch/x86/util/iostat.c b/tools/perf/arch/x86/util/iostat.c
> index 2dc5ac6..f8b4939 100644
> --- a/tools/perf/arch/x86/util/iostat.c
> +++ b/tools/perf/arch/x86/util/iostat.c
> @@ -342,8 +342,10 @@ static int iostat_event_group(struct evlist *evl,
> struct perf_cpu cpu;
> unsigned int cpu_map_idx;
>
> - if (!iostat_cmd)
> - return -ENOMEM;
> + if (!iostat_cmd) {
> + ret = -ENOMEM;
> + goto err;
> + }
>
> for (idx = 0; idx < list->nr_entries; idx++) {
> sprintf(iostat_cmd, iostat_cmd_template,
> --
> 2.9.4
>
next prev parent reply other threads:[~2026-11-09 5:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 2:18 [PATCH] perf iostat: Release the port list if command allocation fails lirongqing
2026-11-09 5:05 ` Namhyung Kim [this message]
2026-11-09 5:18 ` 答复: [外部邮件] " Li,Rongqing
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=avFUi_R0dzVEaT2X@z2 \
--to=namhyung@kernel.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.antonov@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=lirongqing@baidu.com \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--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.