Skip to content

Commit 5521380

Browse files
committed
FIX Missing cleanup function
1 parent e8f17b5 commit 5521380

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

ebpf/mem.ebpf.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include <asm/ptrace.h>
77
#endif
88

9-
#include <bpf/bpf_endian.h>
109
#include <bpf/bpf_helpers.h>
1110
#include <bpf/bpf_tracing.h>
1211

lemon.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ extern int increase_priority_and_launch_stealers(void);
1717
extern int join_cpu_stealers(void);
1818
extern int check_capability(const cap_value_t cap);
1919
extern int toggle_kptr(void);
20+
extern void cleanup_mem_ebpf(void);
2021

2122
/* Constants needed for argparse */
2223
static const struct argp_option options[] = {
@@ -190,6 +191,7 @@ int main(int argc, char **argv)
190191

191192
/* Cleanup: close BPF object */
192193
cleanup:
194+
cleanup_mem_ebpf();
193195
join_cpu_stealers();
194196

195197
/* Restore kptr_restrict if needed */

mem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ int load_ebpf_mem_progs() {
111111
/*
112112
* cleanup_mem_ebpf() - Unmaps the shared memory region used to access map and free eBPF resources.
113113
*/
114-
void cleanup_mmap() {
114+
void cleanup_mem_ebpf() {
115115
if(mem_ebpf_skel) {
116116
if(read_mem_result) munmap(read_mem_result, sizeof(struct read_mem_result));
117117
mem_ebpf__destroy(mem_ebpf_skel);

0 commit comments

Comments
 (0)