From 89f0aafa03ad5878e8902e07e12ec0c020dba2df Mon Sep 17 00:00:00 2001 From: Kairui Song Date: Mon, 19 Aug 2024 19:31:55 +0800 Subject: [PATCH] mm: swap: fix array-bounds error with CONFIG_THP_SWAP=n Signed-off-by: Kairui Song --- mm/swapfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/swapfile.c b/mm/swapfile.c index d9cf31b04db3..16ec6b7df198 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -836,7 +836,7 @@ static unsigned long cluster_alloc_swap_entry(struct swap_info_struct *si, int o goto done; /* Order 0 stealing from higher order */ - for (int o = 1; o < PMD_ORDER; o++) { + for (int o = 1; o < SWAP_NR_ORDERS; o++) { /* * Clusters here have at least one usable slots and can't fail order 0 * allocation, but reclaim may drop si->lock and race with another user. -- 2.45.2