[PATCH v3 0/2] mm/memory: improve insert_pages() error handling
From: Avi Weiss
Date: Sat Aug 29 2026 - 13:13:09 EST
Improve insert_pages() error handling.
The first patch simplifies error handling by initializing the error
status to zero and assigning error codes at their respective failure
sites.
The second patch returns -ENOMEM when walk_to_pmd() fails. A NULL
return from walk_to_pmd() indicates failure to allocate an upper
page-table level, so -ENOMEM is more appropriate than -EFAULT and is
consistent with the subsequent pte_alloc() failure.
Changes in v3:
* drop the walk_to_pmd() rename following review
* use the mm/memory: prefix consistently across the series
* carry review tags from v2
* rebase onto current mm-new
Link: https://lore.kernel.org/r/cover.1785847364.git.thnkslprpt@xxxxxxxxx/
Avi Weiss (2):
mm/memory: simplify error handling in insert_pages()
mm/memory: return -ENOMEM for page-table allocation failure in
insert_pages()
mm/memory.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
base-commit: d2aad7fdcda7ae8a726926f2d6de7fe9e8ee7563
--
2.43.0