From: Norbert Manthey Date: Fri, 17 Feb 2017 14:51:37 +0000 (+0100) Subject: x86/mm: fix memory hotplug error cleanup X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~2751 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=71af7d4220227529ea43b898683d4d2e68a90ffd;p=xen.git x86/mm: fix memory hotplug error cleanup 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 Reviewed-by: Andrew Cooper --- diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c index 9ead02e181..52f2bd5ec5 100644 --- a/xen/arch/x86/x86_64/mm.c +++ b/xen/arch/x86/x86_64/mm.c @@ -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;