Skip to content

Commit

Permalink
powerpc/pseries: Validate PFN in pseries_remove_lmb()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nathan Fontenot authored and Benjamin Herrenschmidt committed Oct 21, 2008
1 parent c10c178 commit 04badfd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions arch/powerpc/platforms/pseries/hotplug-memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));

/*
Expand Down

0 comments on commit 04badfd

Please sign in to comment.