summaryrefslogtreecommitdiffstats
path: root/mm/memory.c
diff options
context:
space:
mode:
authorMiaohe Lin <linmiaohe@huawei.com>2022-03-22 22:42:30 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2022-03-22 23:57:05 +0100
commit88a359125a2b8f2437f09ab3b1af4815c89690d4 (patch)
tree218a2d20e8454ed6ebe2f9fdf5f6f532ac3d332f /mm/memory.c
parentmm/mmap: return 1 from stack_guard_gap __setup() handler (diff)
downloadlinux-88a359125a2b8f2437f09ab3b1af4815c89690d4.tar.xz
linux-88a359125a2b8f2437f09ab3b1af4815c89690d4.zip
mm/memory.c: use helper function range_in_vma()
Use helper function range_in_vma() to check if address, address + size are within the vma range. Minor readability improvement. Link: https://lkml.kernel.org/r/20220219021441.29173-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memory.c')
-rw-r--r--mm/memory.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 2dbb4ac35e93..3cbcf3a3e20a 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1715,7 +1715,7 @@ static void zap_page_range_single(struct vm_area_struct *vma, unsigned long addr
void zap_vma_ptes(struct vm_area_struct *vma, unsigned long address,
unsigned long size)
{
- if (address < vma->vm_start || address + size > vma->vm_end ||
+ if (!range_in_vma(vma, address, address + size) ||
!(vma->vm_flags & VM_PFNMAP))
return;