[PATCH 09/14] mm/ksm: move the no_vmas label out of the if block

From: Longlong Xia

Date: Tue Sep 15 2026 - 11:48:13 EST


From: Longlong Xia <xialonglong@xxxxxxxxxx>

Move no_vmas before the if statement to avoid jumping into its body.
Both goto paths have already found ksm_test_exit(mm) true, and mm_users
cannot rise from zero again, so rechecking the condition is safe.

No functional change intended.

Suggested-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
Assisted-by: Zcode:GLM-5.3
Signed-off-by: Longlong Xia <xialonglong@xxxxxxxxxx>

---
mm/ksm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/ksm.c b/mm/ksm.c
index 1733b23cfaa2..59887a2b4406 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -2760,8 +2760,8 @@ static struct ksm_rmap_item *scan_get_next_rmap_item(struct page **page)
}
}

- if (ksm_test_exit(mm)) {
no_vmas:
+ if (ksm_test_exit(mm)) {
ksm_scan.address = 0;
ksm_scan.rmap_list = &mm_slot->rmap_list;
}
--
2.43.0