Skip to content

Commit bd077a5

Browse files
GeHao01994namhyung
authored andcommitted
perf bpf-filter: Return -ENOMEM directly when pfi allocation fails
Directly return -ENOMEM when pfi allocation fails, instead of performing other operations on pfi. Fixes: 0fe2b18 ("perf bpf-filter: Support multiple events properly") Signed-off-by: Hao Ge <gehao@kylinos.cn> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: hao.ge@linux.dev Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20241113030537.26732-1-hao.ge@linux.dev Signed-off-by: Namhyung Kim <namhyung@kernel.org>
1 parent fc26637 commit bd077a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/perf/util/bpf-filter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ static int create_idx_hash(struct evsel *evsel, struct perf_bpf_filter_entry *en
375375
pfi = zalloc(sizeof(*pfi));
376376
if (pfi == NULL) {
377377
pr_err("Cannot save pinned filter index\n");
378-
goto err;
378+
return -ENOMEM;
379379
}
380380

381381
pfi->evsel = evsel;

0 commit comments

Comments
 (0)