mm/mmap: fix error return code in do_mas_align_munmap()
Subsystems (2)
PATCH 1/1 mm/mmap: fix error return code in do_mas_align_munmap()
Return error code when munmap_sidetree() fails in do_mas_align_munmap().
Fixes 81f5504dfb36 ("mm/mmap: change do_mas_align_munmap() to avoid preallocations for sidetree")
Reported-by Hulk Robot <[email protected]>
Signed-off-by Yang Yingliang <[email protected]>
--- mm/mmap.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
mm/mmap.c +4 -2
@@ -2427,7 +2427,8 @@ do_mas_align_munmap(struct ma_state *mas, struct vm_area_struct *vma,mas_set (mas, end); split =mas_prev (mas,0 ); -if (munmap_sidetree (split, &mas_detach)) + error =munmap_sidetree (split, &mas_detach); +if (error) goto munmap_sidetree_failed; count++;
@@ -2435,7 +2436,8 @@ do_mas_align_munmap(struct ma_state *mas, struct vm_area_struct *vma, vma = split;break ; } -if (munmap_sidetree (next, &mas_detach)) + error =munmap_sidetree (next, &mas_detach); +if (error) goto munmap_sidetree_failed; count++;
Signature · 1 line
2.25.1
I actually have the same patch sitting on my branch, reported by Dan. I have been testing this code before sending it out.
Reviewed-by Liam R. Howlett <[email protected]>
Quoted 36 lines · Yang Yingliang
Return error code when
munmap_sidetree()fails indo_mas_align_munmap().Fixes 81f5504dfb36 ("mm/mmap: change do_mas_align_munmap() to avoid preallocations for sidetree")Reported-by Hulk Robot <[email protected]>Signed-off-by Yang Yingliang <[email protected]>--- mm/mmap.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)mm/mmap.c +4
-2@@ -2427,7 +2427,8 @@ do_mas_align_munmap(struct ma_state *mas, struct vm_area_struct *vma,mas_set (mas, end); split =mas_prev (mas,0 ); -if (munmap_sidetree (split, &mas_detach)) + error =munmap_sidetree (split, &mas_detach); +if (error) goto munmap_sidetree_failed; count++;@@ -2435,7 +2436,8 @@ do_mas_align_munmap(struct ma_state *mas, struct vm_area_struct *vma, vma = split;break ; } -if (munmap_sidetree (next, &mas_detach)) + error =munmap_sidetree (next, &mas_detach); +if (error) goto munmap_sidetree_failed; count++;Signature · 1 line
2.25.1