merge mm-hotfixes-stable into mm-nonmm-stable to pick up stackdepot changes
[linux-block.git] / mm / migrate.c
index 05d6ca437321564925e4f1ac0e2949684c32b1f3..73a052a382f13a21bd72e23fb5996ae07c3022d3 100644 (file)
@@ -2522,6 +2522,14 @@ static int numamigrate_isolate_folio(pg_data_t *pgdat, struct folio *folio)
                        if (managed_zone(pgdat->node_zones + z))
                                break;
                }
+
+               /*
+                * If there are no managed zones, it should not proceed
+                * further.
+                */
+               if (z < 0)
+                       return 0;
+
                wakeup_kswapd(pgdat->node_zones + z, 0,
                              folio_order(folio), ZONE_MOVABLE);
                return 0;