dect
/
linux-2.6
Archived
13
0
Fork 0

powerpc/pseries: Validate PFN in pseries_remove_lmb()

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>
This commit is contained in:
Nathan Fontenot 2008-10-13 08:42:00 +00:00 committed by Benjamin Herrenschmidt
parent c10c178a92
commit 04badfd293
1 changed files with 6 additions and 0 deletions

View 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));
/*