Skip to contentSkip to conversation

nommu: Fix do_munmap() error path

PATCH Applied Liam Howlett 2 participants 2 messages Jan 9, 2023

Subsystems (3)

v1 of 2 Applied 1/1 Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nommu: Fix do_munmap() error path

When removing a VMA from the tree fails due to no memory, do not free the VMA since a reference still exists.

Fixes 8220543df148 ("nommu: remove uses of VMA linked list")
---
 mm/nommu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
mm/nommu.c +2 -1
index c8252f01d5db..844af5be7640 100644
@@ -1509,7 +1509,8 @@ int do_munmap(struct mm_struct *mm, unsigned long start, size_t len, struct list
 erase_whole_vma:
 	if (delete_vma_from_mm(vma))
 		ret = -ENOMEM;
-	delete_vma(mm, vma);
+	else
+		delete_vma(mm, vma);
 	return ret;
 }
 
Signature · 1 line
2.35.1
#1 lore raw
FYI: kernel test robot notices the stable kernel rule is not satisfied.

Hi,

Thanks for your patch.

FYI: kernel test robot notices the stable kernel rule is not satisfied.

Rule: 'Cc: [email protected]' or 'commit <sha1> upstream.'
Subject: [PATCH] nommu: Fix do_munmap() error path

The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests