From: Nathan Fontenot Date: Wed, 1 Oct 2008 09:44:02 +0000 (+0000) Subject: powerpc: Oops in pseries_lmb_remove() X-Git-Tag: v2.6.28-rc1~569^2~35 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=9fd3f88cb67ac51bd5face8441472b91e042be67;p=linux-2.6-omap-h63xx.git powerpc: Oops in pseries_lmb_remove() Testing hotplug memory remove has revealed that we can oops in pseries_lmb_remove(). The incorrect shift causes a NULL pointer dereference in the page_zone() inline routine. I have only been able to reproduce the oops on kernels with large pages enabled. Tested on Power5 and Power6 with and without large pages enabled. Signed-off-by: Nathan Fontenot Signed-off-by: Benjamin Herrenschmidt --- diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c index a1a368dd2d9..140d02a5232 100644 --- a/arch/powerpc/platforms/pseries/hotplug-memory.c +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c @@ -21,7 +21,7 @@ static int pseries_remove_lmb(unsigned long base, unsigned int lmb_size) struct zone *zone; int ret; - start_pfn = base >> PFN_SECTION_SHIFT; + start_pfn = base >> PAGE_SHIFT; zone = page_zone(pfn_to_page(start_pfn)); /*