summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGaosheng Cui <cuigaosheng1@huawei.com>2022-04-21 11:18:03 +0800
committerAndrii Nakryiko <andrii@kernel.org>2022-04-21 09:56:26 -0700
commitb71a2ebf74ef509b6b6926c78549e183c3b63947 (patch)
treed39ff257e0e73b54bdbb44bfbe067b8a8065d63e /tools
parentc14766a8a8f3d6c75bf09ec3b6d9ce4d8217015a (diff)
downloadlinux-b71a2ebf74ef509b6b6926c78549e183c3b63947.tar.bz2
libbpf: Remove redundant non-null checks on obj_elf
Obj_elf is already non-null checked at the function entry, so remove redundant non-null checks on obj_elf. Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20220421031803.2283974-1-cuigaosheng1@huawei.com
Diffstat (limited to 'tools')
-rw-r--r--tools/lib/bpf/libbpf.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 94940497354b..873a29ce7781 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -1233,10 +1233,8 @@ static void bpf_object__elf_finish(struct bpf_object *obj)
if (!obj->efile.elf)
return;
- if (obj->efile.elf) {
- elf_end(obj->efile.elf);
- obj->efile.elf = NULL;
- }
+ elf_end(obj->efile.elf);
+ obj->efile.elf = NULL;
obj->efile.symbols = NULL;
obj->efile.st_ops_data = NULL;