From: Andrew Morton Date: Wed, 20 Feb 2013 02:14:17 +0000 (+1100) Subject: memory-hotplug-common-apis-to-support-page-tables-hot-remove-fix-fix-fix-fix-fix... X-Git-Tag: next-20130220~1^2~535 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=30c426867d882a71dda794720f92495b2359072b;p=karo-tx-linux.git memory-hotplug-common-apis-to-support-page-tables-hot-remove-fix-fix-fix-fix-fix-fix-fix fix used-uninitialised bug Cc: Jiang Liu Cc: Jianguo Wu Cc: Kamezawa Hiroyuki Cc: Lai Jiangshan Cc: Tang Chen Cc: Wen Congyang Cc: Yasuaki Ishimatsu Cc: Yinghai Lu Signed-off-by: Andrew Morton --- diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 6bcca6563c28..ca6cd403a275 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c @@ -993,12 +993,12 @@ remove_pagetable(unsigned long start, unsigned long end, bool direct) bool pgd_changed = false; for (; start < end; start = next) { + next = pgd_addr_end(start, end); + pgd = pgd_offset_k(start); if (!pgd_present(*pgd)) continue; - next = pgd_addr_end(start, end); - pud = (pud_t *)pgd_page_vaddr(*pgd); remove_pud_table(pud, start, next, direct); if (free_pud_table(pud, pgd))