diff --git a/lib/sbi/riscv_asm.c b/lib/sbi/riscv_asm.c index 05b8c7ce6e3..c7d75ac0155 100644 --- a/lib/sbi/riscv_asm.c +++ b/lib/sbi/riscv_asm.c @@ -291,7 +291,8 @@ int is_pmp_entry_mapped(unsigned long entry) unsigned long addr; unsigned long log2len; - pmp_get(entry, &prot, &addr, &log2len); + if (pmp_get(entry, &prot, &addr, &log2len) != 0) + return false; /* If address matching bits are non-zero, the entry is enable */ if (prot & PMP_A)