Skip to content
Snippets Groups Projects
Commit 659c55ef authored by Xiao Yang's avatar Xiao Yang Committed by Andrew Morton
Browse files

mm/vma: return the exact errno in vms_gather_munmap_vmas()

__split_vma() and mas_store_gfp() returns several types of errno on
failure so don't ignore them in vms_gather_munmap_vmas().  For example,
__split_vma() returns -EINVAL when an unaligned huge page is unmapped. 
This issue is reproduced by ltp memfd_create03 test.

Don't initialise the error variable and assign it when a failure actually
occurs.

[akpm@linux-foundation.org: fix whitespace, per Liam]
Link: https://lkml.kernel.org/r/20240909125621.1994-1-ice_yangxiao@163.com


Fixes: 6898c903 ("mm/vma: extract the gathering of vmas from do_vmi_align_munmap()")
Signed-off-by: default avatarXiao Yang <ice_yangxiao@163.com>
Suggested-by: default avatarLorenzo Stoakes <lorenzo.stoakes@oracle.com>
Reported-by: default avatarkernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202409081536.d283a0fb-oliver.sang@intel.com


Cc: "Liam R. Howlett" <Liam.Howlett@oracle.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent f2c5101b
Branches
Tags
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment