summaryrefslogtreecommitdiffstats
path: root/libnetdata
diff options
context:
space:
mode:
authorthiagoftsm <thiagoftsm@gmail.com>2023-06-12 14:35:21 +0000
committerGitHub <noreply@github.com>2023-06-12 14:35:21 +0000
commit132e31ce9e9a56c40c481071ee8993a0607508cc (patch)
treedf8f3a3ca95833f2d5a67ac77f1380070f73ef62 /libnetdata
parent3e302188637fca7dc1fc676e5672d14730efbd84 (diff)
eBPF unittest + bug fix (#15146)
Diffstat (limited to 'libnetdata')
-rw-r--r--libnetdata/ebpf/ebpf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libnetdata/ebpf/ebpf.c b/libnetdata/ebpf/ebpf.c
index caaefc3207..b980d09eda 100644
--- a/libnetdata/ebpf/ebpf.c
+++ b/libnetdata/ebpf/ebpf.c
@@ -856,8 +856,10 @@ struct bpf_link **ebpf_load_program(char *plugins_dir, ebpf_module_t *em, int kv
em->load |= EBPF_LOAD_LEGACY;
*obj = bpf_object__open_file(lpath, NULL);
+ if (!*obj)
+ return NULL;
+
if (libbpf_get_error(obj)) {
- error("Cannot open BPF object %s", lpath);
bpf_object__close(*obj);
return NULL;
}