diff --git a/kpatch-build/kpatch-elf.c b/kpatch-build/kpatch-elf.c index aa658bc..45a5a3e 100644 --- a/kpatch-build/kpatch-elf.c +++ b/kpatch-build/kpatch-elf.c @@ -341,7 +341,7 @@ static void kpatch_find_fentry_calls(struct kpatch_elf *kelf) struct symbol *sym; struct rela *rela; list_for_each_entry(sym, &kelf->symbols, list) { - if (sym->type != STT_FUNC || !sym->sec->rela) + if (sym->type != STT_FUNC || !sym->sec || !sym->sec->rela) continue; rela = list_first_entry(&sym->sec->rela->relas, struct rela,