projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6fe7d71
)
mm/mincore.c: use vma_lookup() instead of find_vma()
author
Deming Wang
<wangdeming@inspur.com>
Fri, 7 Oct 2022 03:03:45 +0000
(23:03 -0400)
committer
Andrew Morton
<akpm@linux-foundation.org>
Wed, 9 Nov 2022 01:37:13 +0000
(17:37 -0800)
Using vma_lookup() verifies the start address is contained in the found
vma. This results in easier to read the code.
Link:
https://lkml.kernel.org/r/20221007030345.5029-1-wangdeming@inspur.com
Signed-off-by: Deming Wang <wangdeming@inspur.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/mincore.c
patch
|
blob
|
history
diff --git
a/mm/mincore.c
b/mm/mincore.c
index
fa200c1
..
e7e046f
100644
(file)
--- a/
mm/mincore.c
+++ b/
mm/mincore.c
@@
-190,8
+190,8
@@
static long do_mincore(unsigned long addr, unsigned long pages, unsigned char *v
unsigned 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)) {