Skip to content

Commit b71a2eb

Browse files
gscuianakryiko
authored andcommitted
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 <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent c14766a commit b71a2eb

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tools/lib/bpf/libbpf.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,10 +1233,8 @@ static void bpf_object__elf_finish(struct bpf_object *obj)
12331233
if (!obj->efile.elf)
12341234
return;
12351235

1236-
if (obj->efile.elf) {
1237-
elf_end(obj->efile.elf);
1238-
obj->efile.elf = NULL;
1239-
}
1236+
elf_end(obj->efile.elf);
1237+
obj->efile.elf = NULL;
12401238
obj->efile.symbols = NULL;
12411239
obj->efile.st_ops_data = NULL;
12421240

0 commit comments

Comments
 (0)