]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm/mprotect: Use vma_next() instead of mas_next().
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Wed, 17 Feb 2021 22:15:37 +0000 (17:15 -0500)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Wed, 17 Feb 2021 22:15:37 +0000 (17:15 -0500)
mas is in the wrong state and would potentially return the current vma twice.

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
mm/mprotect.c

index 676224803726ffe016b39e1142e35c5124e84a78..6dbd5f685ffb0e1f56c8a6232d62aa0828c499e3 100644 (file)
@@ -634,7 +634,7 @@ static int do_mprotect_pkey(unsigned long start, size_t len,
                if (nstart >= end)
                        goto out;
 
-               vma = mas_next(&mas, ULONG_MAX);
+               vma = vma_next(current->mm, vma);
                if (!vma || vma->vm_start != nstart) {
                        error = -ENOMEM;
                        goto out;