Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next
[linux-2.6-microblaze.git] / tools / lib / bpf / libbpf.c
index f6b91fb..48c0ade 100644 (file)
@@ -3266,6 +3266,9 @@ static int add_dummy_ksym_var(struct btf *btf)
        const struct btf_var_secinfo *vs;
        const struct btf_type *sec;
 
+       if (!btf)
+               return 0;
+
        sec_btf_id = btf__find_by_name_kind(btf, KSYMS_SEC,
                                            BTF_KIND_DATASEC);
        if (sec_btf_id < 0)