]> xenbits.xensource.com Git - xen.git/commitdiff
x86/mm: fix memory hotplug error cleanup
authorNorbert Manthey <nmanthey@amazon.com>
Fri, 17 Feb 2017 14:51:37 +0000 (15:51 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 17 Feb 2017 14:51:37 +0000 (15:51 +0100)
During destroying the m2p mapping, the loop variable was always incremented
by one, as the current version used a compare operator on the left hand side,
which always evaluated to true, i.e.

i += 1UL < (L2_PAGETABLE_SHIFT - 2)

The fix increments the value of the variable by the actual page size by
using the shift operator instead.

Signed-off-by: Norbert Manthey <nmanthey@amazon.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/x86_64/mm.c

index 9ead02e181b0e18e62d3702ea3fad78f34528172..52f2bd5ec5efd2f9bd465965022099b7fcf642c6 100644 (file)
@@ -251,7 +251,7 @@ static void destroy_compat_m2p_mapping(struct mem_hotadd_info *info)
             }
         }
 
-        i += 1UL < (L2_PAGETABLE_SHIFT - 2);
+        i += 1UL << (L2_PAGETABLE_SHIFT - 2);
     }
 
     return;