Messages in this thread Patch in this message | | | From | Wang Nan <> | Subject | [RFC PATCH v2 18/37] tools lib bpf: clean elf memory after loading. | Date | Fri, 15 May 2015 07:51:11 +0000 |
| |
After all eBPF programs in an object file are loaded, related ELF information is useless. Close the object file and free those memory.
Signed-off-by: Wang Nan <wangnan0@huawei.com> --- tools/lib/bpf/libbpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index ded96cb..9ed8cca 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -687,8 +687,8 @@ struct bpf_object *bpf_open_object(const char *path) if (bpf_obj_validate(obj)) goto out; + bpf_obj_clear_elf(obj); return obj; - out: bpf_close_object(obj); return NULL; -- 1.8.3.4
| |