]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
xen/mm: pg_offlined can be defined as bool in free_heap_pages()
authorJulien Grall <jgrall@amazon.com>
Wed, 23 Feb 2022 19:08:33 +0000 (19:08 +0000)
committerJulien Grall <jgrall@amazon.com>
Thu, 24 Feb 2022 17:32:43 +0000 (17:32 +0000)
The local variable pg_offlined in free_heap_pages() can only take two
values. So switch it to a bool.

Fixes: 289610483fc43 ("mm: fix broken tainted value in mark_page_free")
Signed-off-by: Julien Grall <jgrall@amazon.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/common/page_alloc.c

index e971bf91e0be5b92d2e2c78a82e1bc5ee31d4145..319029140f3040a4a4f5c425122bb80852d626e6 100644 (file)
@@ -1437,8 +1437,9 @@ static void free_heap_pages(
 {
     unsigned long mask;
     mfn_t mfn = page_to_mfn(pg);
-    unsigned int i, node = phys_to_nid(mfn_to_maddr(mfn)), pg_offlined = 0;
+    unsigned int i, node = phys_to_nid(mfn_to_maddr(mfn));
     unsigned int zone = page_to_zone(pg);
+    bool pg_offlined = false;
 
     ASSERT(order <= MAX_ORDER);
 
@@ -1447,7 +1448,7 @@ static void free_heap_pages(
     for ( i = 0; i < (1 << order); i++ )
     {
         if ( mark_page_free(&pg[i], mfn_add(mfn, i)) )
-            pg_offlined = 1;
+            pg_offlined = true;
 
         if ( need_scrub )
         {