bpftool: Don't crash on missing jited insns or ksyms
[linux-2.6-microblaze.git] / tools / bpf / bpftool / xlated_dumper.c
index 494d7ae..5b91ee6 100644 (file)
@@ -174,7 +174,7 @@ static const char *print_call(void *private_data,
        struct kernel_sym *sym;
 
        if (insn->src_reg == BPF_PSEUDO_CALL &&
-           (__u32) insn->imm < dd->nr_jited_ksyms)
+           (__u32) insn->imm < dd->nr_jited_ksyms && dd->jited_ksyms)
                address = dd->jited_ksyms[insn->imm];
 
        sym = kernel_syms_search(dd, address);