Skip to contentSkip to conversation

mm/damon/paddr: initialize nr_succeeded in __damon_pa_migrate_folio_list()

PATCH Applied SeongJae Park 1 participant 1 message Jul 1, 2024

Subsystems (2)
lore
Share & tools
lore

SeongJae Park

author maintainer
#0 lore raw

PATCH 1/1 mm/damon/paddr: initialize nr_succeeded in __damon_pa_migrate_folio_list()

The variable is supposed to be set via later migrate_pages() call. However, the function does not do that when CONFIG_MIGRATION is unset. Initialize the variable to zero.

Fixes 5311c0a2eee3 ("mm/damon/paddr: introduce DAMOS_MIGRATE_COLD action for demotion") # mm-stable
---
 mm/damon/paddr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/damon/paddr.c +1 -1
index af6aac388a43..a9ff35341d65 100644
@@ -332,7 +332,7 @@ static unsigned int __damon_pa_migrate_folio_list(
 		struct list_head *migrate_folios, struct pglist_data *pgdat,
 		int target_nid)
 {
-	unsigned int nr_succeeded;
+	unsigned int nr_succeeded = 0;
 	nodemask_t allowed_mask = NODE_MASK_NONE;
 	struct migration_target_control mtc = {
 		/*
Signature · 1 line
2.39.2