Linux Perf Users
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: lirongqing <lirongqing@baidu.com>, linux-perf-users@vger.kernel.org
Subject: Re: [PATCH, next, v2] perf iostat: Release the port list if command allocation fails
Date: Mon, 09 Nov 2026 09:06:14 +0000	[thread overview]
Message-ID: <sashiko-outbox-204667@kernel.org> (raw)
In-Reply-To: <20261109090143.1749-1-lirongqing@baidu.com>

> From: Li RongQing <lirongqing@baidu.com>
> 
> iostat_event_group() takes ownership of the root port list and frees it
> via the err: label on both the normal and parsing-error paths. When
> calloc() for iostat_cmd fails, however, the function returns -ENOMEM
> directly, leaking the list, its pointer array and every port in it.
> 
> Route this failure through the existing cleanup path instead. At this
> point no port has been transferred to an event yet, so
> iio_root_ports_list_free() releases the whole list, and the trailing
> free(iostat_cmd) is a no-op on the NULL pointer.
> 
> Fixes: f9ed693e8bc0 ("perf stat: Enable iostat mode for x86 platforms")
> Signed-off-by: Li RongQing <lirongqing@baidu.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261109090143.1749-1-lirongqing@baidu.com?part=1


  reply	other threads:[~2026-11-09  9:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-09  9:01 [PATCH, next, v2] perf iostat: Release the port list if command allocation fails lirongqing
2026-11-09  9:06 ` sashiko-bot [this message]
2026-11-11 19:09 ` Namhyung Kim

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=sashiko-outbox-204667@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=lirongqing@baidu.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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