mirror of
https://github.com/adulau/aha.git
synced 2024-12-30 20:56:23 +00:00
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:
parent
c10c178a92
commit
04badfd293
1 changed files with 6 additions and 0 deletions
|
@ -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));
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue