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.
This commit is contained in:
parent
fa6ba05097
commit
58b5a0412e
@ -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 */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user