]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
powerpc/pseries: Validate PFN in pseries_remove_lmb()
authorNathan Fontenot <nfont@austin.ibm.com>
Mon, 13 Oct 2008 08:42:00 +0000 (08:42 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 21 Oct 2008 04:17:47 +0000 (15:17 +1100)
The pfn of the memory to be removed should be validated prior to
attempting to remove the memory.  In cases where the probe of a
memory section fails during hotplug add, the pfn for the lmb may
not be valid.

Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com>
Signed-off-by: Nathan Fontenot <nfont@austin.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/platforms/pseries/hotplug-memory.c

index 140d02a5232af273b617a464fa08052438266262..a623ad256e9e500684cd972ccae1be3b4866c62e 100644 (file)
@@ -22,6 +22,12 @@ static int pseries_remove_lmb(unsigned long base, unsigned int lmb_size)
        int ret;
 
        start_pfn = base >> PAGE_SHIFT;
+
+       if (!pfn_valid(start_pfn)) {
+               lmb_remove(base, lmb_size);
+               return 0;
+       }
+
        zone = page_zone(pfn_to_page(start_pfn));
 
        /*