mm: use vma_lookup() instead of find_vma()
Subsystems (2)
PATCH 1/1 mm: use vma_lookup() instead of find_vma()
Using vma_lookup() verifies the start address is contained in the found vma. This results in easier to read the code.
Signed-off-by Deming Wang <[email protected]>
--- mm/mincore.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
mm/mincore.c +2 -2
@@ -190,8 +190,8 @@ static long do_mincore(unsigned long addr, unsigned long pages, unsigned char *vunsigned long end;int err; - vma =find_vma (current->mm, addr); -if (!vma || addr < vma->vm_start) + vma =vma_lookup (current->mm, addr); +if (!vma)return -ENOMEM ; end =min (vma->vm_end, addr + (pages <<PAGE_SHIFT ));if (!can_do_mincore (vma)) {
Signature · 1 line
2.27.0