riscv/addrenv_shm: Add missing sanity check to up_shmdt()
A missing sanity check, make sure the last level page table actually exists
before trying to clear entries from it.
@@ -159,6 +159,10 @@ int up_shmdt(uintptr_t vaddr, unsigned int npages)
paddr = mmu_pte_to_paddr(mmu_ln_getentry(ptlevel, ptprev, vaddr));
ptlast = riscv_pgvaddr(paddr);
+ if (!ptlast)
+ {
+ return -EFAULT;
+ }
/* Then wipe the reference */
