linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/pseries: fix oops in hotplug memory notifier
@ 2019-06-07  5:04 Nathan Lynch
  2019-06-07 13:08 ` Michael Ellerman
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Nathan Lynch @ 2019-06-07  5:04 UTC (permalink / raw)
  To: linuxppc-dev

During post-migration device tree updates, we can oops in
pseries_update_drconf_memory if the source device tree has an
ibm,dynamic-memory-v2 property and the destination has a
ibm,dynamic_memory (v1) property. The notifier processes an "update"
for the ibm,dynamic-memory property but it's really an add in this
scenario. So make sure the old property object is there before
dereferencing it.

Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com>
---
 arch/powerpc/platforms/pseries/hotplug-memory.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index 47087832f8b2..e6bd172bcf30 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -980,6 +980,9 @@ static int pseries_update_drconf_memory(struct of_reconfig_data *pr)
 	if (!memblock_size)
 		return -EINVAL;
 
+	if (!pr->old_prop)
+		return 0;
+
 	p = (__be32 *) pr->old_prop->value;
 	if (!p)
 		return -EINVAL;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-06-15 22:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-07  5:04 [PATCH] powerpc/pseries: fix oops in hotplug memory notifier Nathan Lynch
2019-06-07 13:08 ` Michael Ellerman
2019-06-07 14:59   ` Nathan Lynch
2019-06-07 22:23 ` Tyrel Datwyler
2019-06-07 23:39   ` Nathan Lynch
2019-06-14  1:05     ` Nathan Lynch
2019-06-15 22:22       ` Tyrel Datwyler
2019-06-15 13:36 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).