]> git.baikalelectronics.ru Git - kernel.git/commit
mmap: fix remap_file_pages() regression
authorLiam Howlett <liam.howlett@oracle.com>
Tue, 25 Oct 2022 16:12:49 +0000 (16:12 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 28 Oct 2022 20:37:23 +0000 (13:37 -0700)
commit9278e3c396d2e41ef0dfe86a912ed75ce35e197a
tree3e21ddbce2216c7719f737f47e05574fff1d4960
parenta32407a7e9ddb7a734bb59b607222764d70392bf
mmap: fix remap_file_pages() regression

When using the VMA iterator, the final execution will set the variable
'next' to NULL which causes the function to fail out.  Restore the break
in the loop to exit the VMA iterator early without clearing NULL fixes the
issue.

Link: https://lore.kernel.org/lkml/29344.1666681759@jrobl/
Link: https://lkml.kernel.org/r/20221025161222.2634030-1-Liam.Howlett@oracle.com
Fixes: eb6589574240 (mm: remove the vma linked list)
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Reported-by: "J. R. Okajima" <hooanon05g@gmail.com>
Tested-by: "J. R. Okajima" <hooanon05g@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/mmap.c