aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/mm/mmap.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-06-17 19:48:13 -0700
committerDavid S. Miller <davem@davemloft.net>2019-06-17 20:20:36 -0700
commit13091aa30535b719e269f20a7bc34002bf5afae5 (patch)
treebd17956c3ce606a119fadbd43bfa1c0c10006984 /arch/mips/mm/mmap.c
parentMerge branch 'UDP-GSO-audit-tests' (diff)
parentMerge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs (diff)
downloadlinux-dev-13091aa30535b719e269f20a7bc34002bf5afae5.tar.xz
linux-dev-13091aa30535b719e269f20a7bc34002bf5afae5.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Honestly all the conflicts were simple overlapping changes, nothing really interesting to report. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/mips/mm/mmap.c')
-rw-r--r--arch/mips/mm/mmap.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/mips/mm/mmap.c b/arch/mips/mm/mmap.c
index 2f616ebeb7e0..50ee7213b432 100644
--- a/arch/mips/mm/mmap.c
+++ b/arch/mips/mm/mmap.c
@@ -201,8 +201,13 @@ unsigned long arch_randomize_brk(struct mm_struct *mm)
return ret;
}
-int __virt_addr_valid(const volatile void *kaddr)
+bool __virt_addr_valid(const volatile void *kaddr)
{
+ unsigned long vaddr = (unsigned long)vaddr;
+
+ if ((vaddr < PAGE_OFFSET) || (vaddr >= MAP_BASE))
+ return false;
+
return pfn_valid(PFN_DOWN(virt_to_phys(kaddr)));
}
EXPORT_SYMBOL_GPL(__virt_addr_valid);