summaryrefslogtreecommitdiffstats
path: root/mm/swap.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/swap.c')
-rw-r--r--mm/swap.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/mm/swap.c b/mm/swap.c
index 67a246772811..6b838986d294 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -226,12 +226,10 @@ static void __folio_batch_add_and_move(struct folio_batch __percpu *fbatch,
{
unsigned long flags;
- folio_get(folio);
-
- if (on_lru && !folio_test_clear_lru(folio)) {
- folio_put(folio);
+ if (on_lru && !folio_test_clear_lru(folio))
return;
- }
+
+ folio_get(folio);
if (disable_irq)
local_lock_irqsave(&cpu_fbatches.lock_irq, flags);