Skip to contentSkip to conversation

powerpc: pseries_remove_lmb() should validate pfn

PATCH New Nathan Fontenot 1 participant 1 message Oct 13, 2008 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: pseries_remove_lmb() should validate pfn

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.

---

arch/powerpc/platforms/pseries/hotplug-memory.c +0 -0
@@ -22,6 +22,12 @@
	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));

	/*