From c6e34888b5d8d085f2682519cea427640fe97c48 Mon Sep 17 00:00:00 2001 From: Ksawlii Date: Sun, 24 Nov 2024 00:23:40 +0100 Subject: [PATCH] Revert "libbpf: Add NULL checks to bpf_object__{prev_map,next_map}" This reverts commit 532ee6e841c3276dadecc35ca534a35459846461. --- tools/lib/bpf/libbpf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index 33cdcfe10..015ed8253 100755 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -9005,7 +9005,7 @@ __bpf_map__iter(const struct bpf_map *m, const struct bpf_object *obj, int i) struct bpf_map * bpf_map__next(const struct bpf_map *prev, const struct bpf_object *obj) { - if (prev == NULL && obj != NULL) + if (prev == NULL) return obj->maps; return __bpf_map__iter(prev, obj, 1); @@ -9014,7 +9014,7 @@ bpf_map__next(const struct bpf_map *prev, const struct bpf_object *obj) struct bpf_map * bpf_map__prev(const struct bpf_map *next, const struct bpf_object *obj) { - if (next == NULL && obj != NULL) { + if (next == NULL) { if (!obj->nr_maps) return NULL; return obj->maps + obj->nr_maps - 1;