mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
powerpc/pseries: Fix oops in hotplug memory notifier
commit0aa82c482aupstream. 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. Fixes:2b31e3aec1("powerpc/drmem: Add support for ibm, dynamic-memory-v2 property") Cc: stable@vger.kernel.org # v4.16+ Signed-off-by: Nathan Lynch <nathanl@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e725502b85
commit
01982f7bcc
@@ -1012,6 +1012,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;
|
||||
|
||||
Reference in New Issue
Block a user