diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h index 44d3fdbcdf62..0243b6d22453 100644 --- a/arch/arm64/include/asm/kvm_mmu.h +++ b/arch/arm64/include/asm/kvm_mmu.h @@ -439,7 +439,8 @@ static inline void *kvm_get_hyp_vector(void) int slot = -1; if ((cpus_have_const_cap(ARM64_HARDEN_BRANCH_PREDICTOR) || - cpus_have_const_cap(ARM64_SPECTRE_BHB)) && data->template_start) { + cpus_have_const_cap(ARM64_SPECTRE_BHB)) && + data && data->template_start) { vect = kern_hyp_va(kvm_ksym_ref(__bp_harden_hyp_vecs_start)); slot = data->hyp_vectors_slot; }