diff options
author | Nathan Fontenot <nfont@austin.ibm.com> | 2008-10-13 04:42:00 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2008-10-21 00:17:47 -0400 |
commit | 04badfd2936333a23e0fc233f31a760d0dc9424f (patch) | |
tree | f2889549126aaef3e3bf80b52ccb74d0bbc8831e /arch | |
parent | c10c178a92b032ea3dd7259dcbbd1b9331c05c41 (diff) |
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/pseries/hotplug-memory.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c index 140d02a5232a..a623ad256e9e 100644 --- a/arch/powerpc/platforms/pseries/hotplug-memory.c +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c | |||
@@ -22,6 +22,12 @@ static int pseries_remove_lmb(unsigned long base, unsigned int lmb_size) | |||
22 | int ret; | 22 | int ret; |
23 | 23 | ||
24 | start_pfn = base >> PAGE_SHIFT; | 24 | start_pfn = base >> PAGE_SHIFT; |
25 | |||
26 | if (!pfn_valid(start_pfn)) { | ||
27 | lmb_remove(base, lmb_size); | ||
28 | return 0; | ||
29 | } | ||
30 | |||
25 | zone = page_zone(pfn_to_page(start_pfn)); | 31 | zone = page_zone(pfn_to_page(start_pfn)); |
26 | 32 | ||
27 | /* | 33 | /* |