diff options
| author | Ryan Roberts <[email protected]> | 2025-02-26 12:16:09 +0000 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2025-03-06 05:36:18 +0000 |
| commit | 3685024edd270f7c791f993157d65d3c928f3d6e (patch) | |
| tree | 0a9f2f2f2895176e4aa516c57df03e1e901b7a82 /mm/vmalloc.c | |
| parent | mm: shmem: remove unnecessary warning in shmem_writepage() (diff) | |
| download | kernel-3685024edd270f7c791f993157d65d3c928f3d6e.tar.gz kernel-3685024edd270f7c791f993157d65d3c928f3d6e.zip | |
mm: don't skip arch_sync_kernel_mappings() in error paths
Fix callers that previously skipped calling arch_sync_kernel_mappings() if
an error occurred during a pgtable update. The call is still required to
sync any pgtable updates that may have occurred prior to hitting the error
condition.
These are theoretical bugs discovered during code review.
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 2ba3e6947aed ("mm/vmalloc: track which page-table levels were modified")
Fixes: 0c95cba49255 ("mm: apply_to_pte_range warn and fail if a large pte is encountered")
Signed-off-by: Ryan Roberts <[email protected]>
Reviewed-by: Anshuman Khandual <[email protected]>
Reviewed-by: Catalin Marinas <[email protected]>
Cc: Christop Hellwig <[email protected]>
Cc: "Uladzislau Rezki (Sony)" <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'mm/vmalloc.c')
| -rw-r--r-- | mm/vmalloc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index a6e7acebe9ad..61981ee1c9d2 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -586,13 +586,13 @@ static int vmap_small_pages_range_noflush(unsigned long addr, unsigned long end, mask |= PGTBL_PGD_MODIFIED; err = vmap_pages_p4d_range(pgd, addr, next, prot, pages, &nr, &mask); if (err) - return err; + break; } while (pgd++, addr = next, addr != end); if (mask & ARCH_PAGE_TABLE_SYNC_MASK) arch_sync_kernel_mappings(start, end); - return 0; + return err; } /* |
