From: Namhyung Kim <namhyung@kernel.org>
To: Hao Ge <hao.ge@linux.dev>
Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
mark.rutland@arm.com, alexander.shishkin@linux.intel.com,
jolsa@kernel.org, irogers@google.com, adrian.hunter@intel.com,
kan.liang@linux.intel.com, linux-perf-users@vger.kernel.org,
linux-kernel@vger.kernel.org, bpf@vger.kernel.org,
Hao Ge <gehao@kylinos.cn>
Subject: Re: [PATCH v2] perf bpf-filter: Return -ENOMEM directly when pfi allocation fails
Date: Mon, 18 Nov 2024 16:08:14 -0800 [thread overview]
Message-ID: <ZzvW7qjkVYWMSNP5@google.com> (raw)
In-Reply-To: <20241113030537.26732-1-hao.ge@linux.dev>
On Wed, Nov 13, 2024 at 11:05:37AM +0800, Hao Ge wrote:
> From: Hao Ge <gehao@kylinos.cn>
>
> Directly return -ENOMEM when pfi allocation fails,
> instead of performing other operations on pfi.
>
> Fixes: 0fe2b18ddc40 ("perf bpf-filter: Support multiple events properly")
> Signed-off-by: Hao Ge <gehao@kylinos.cn>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Thanks,
Namhyung
> ---
> v2: Replace -1 with -ENOMEM as per Arnaldo's reminder.
> Update title and commit message due to code change
> ---
> tools/perf/util/bpf-filter.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/util/bpf-filter.c b/tools/perf/util/bpf-filter.c
> index e87b6789eb9e..a4fdf6911ec1 100644
> --- a/tools/perf/util/bpf-filter.c
> +++ b/tools/perf/util/bpf-filter.c
> @@ -375,7 +375,7 @@ static int create_idx_hash(struct evsel *evsel, struct perf_bpf_filter_entry *en
> pfi = zalloc(sizeof(*pfi));
> if (pfi == NULL) {
> pr_err("Cannot save pinned filter index\n");
> - goto err;
> + return -ENOMEM;
> }
>
> pfi->evsel = evsel;
> --
> 2.25.1
>
next prev parent reply other threads:[~2024-11-19 0:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-12 2:28 [PATCH] perf bpf-filter: Return -1 directly when pfi allocation fails Hao Ge
2024-11-12 16:58 ` Arnaldo Carvalho de Melo
2024-11-13 3:05 ` [PATCH v2] perf bpf-filter: Return -ENOMEM " Hao Ge
2024-11-19 0:08 ` Namhyung Kim [this message]
2024-11-22 22:17 ` 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=ZzvW7qjkVYWMSNP5@google.com \
--to=namhyung@kernel.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=bpf@vger.kernel.org \
--cc=gehao@kylinos.cn \
--cc=hao.ge@linux.dev \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--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 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).