From: Liam R. Howlett Date: Thu, 18 Feb 2021 14:24:49 +0000 (-0500) Subject: mm/mprotect: Use vma_next() of prev. X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=8930eddeac4d1e32f82d1911c1f4ce099b0cd788;p=users%2Fjedix%2Flinux-maple.git mm/mprotect: Use vma_next() of prev. The linked list used to use prev->next. the maple state may be invalidated by the mprotect_fixup call which may alter the tree. Signed-off-by: Liam R. Howlett --- diff --git a/mm/mprotect.c b/mm/mprotect.c index 6dbd5f685ffb0..0ecc4fbee3327 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c @@ -634,7 +634,7 @@ static int do_mprotect_pkey(unsigned long start, size_t len, if (nstart >= end) goto out; - vma = vma_next(current->mm, vma); + vma = vma_next(current->mm, prev); if (!vma || vma->vm_start != nstart) { error = -ENOMEM; goto out;