[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241113030537.26732-1-hao.ge@linux.dev>
Date: Wed, 13 Nov 2024 11:05:37 +0800
From: Hao Ge <hao.ge@...ux.dev>
To: peterz@...radead.org,
mingo@...hat.com,
acme@...nel.org,
namhyung@...nel.org,
mark.rutland@....com,
alexander.shishkin@...ux.intel.com,
jolsa@...nel.org,
irogers@...gle.com,
adrian.hunter@...el.com,
kan.liang@...ux.intel.com
Cc: linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org,
bpf@...r.kernel.org,
hao.ge@...ux.dev,
Hao Ge <gehao@...inos.cn>
Subject: [PATCH v2] perf bpf-filter: Return -ENOMEM directly when pfi allocation fails
From: Hao Ge <gehao@...inos.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@...inos.cn>
---
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
Powered by blists - more mailing lists