v3
2026-08-30
改进 insert_pages 错误返回码 · v3
改进 insert_pages() 错误处理:初始化 error 并在失败处赋值,walk_to_pmd() 失败返回 -ENOMEM
原始补丁链接
子 Patch(2)
1/2
mm/memory: simplify error handling in insert_pages()
Initialize error return status to zero and then set it as needed at each point of failure. Assign -ENOMEM explicitly when pte_alloc() fails as the pte_alloc() macro returns a boolean. Signed-off-by:
2/2
mm/memory: return -ENOMEM for page-table allocation failure in insert_pages()
walk_to_pmd() returns NULL only when p4d_alloc(), pud_alloc(), or pmd_alloc() fails. These are page-table allocation failures, but insert_pages() currently reports them as -EFAULT. Return -ENOMEM ins