]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
powerpc/pseries: Fix oops in hotplug memory notifier
authorNathan Lynch <nathanl@linux.ibm.com>
Fri, 7 Jun 2019 05:04:07 +0000 (00:04 -0500)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commitc3cb5337afa8152510dc670bb4969ae4e2c4058e
tree4f6b54579a77f5a2d32b95d7458b58d3b790c86e
parent0a8446da28f35c934e34425da70ddd77d4dbf044
powerpc/pseries: Fix oops in hotplug memory notifier

BugLink: https://bugs.launchpad.net/bugs/1839036
commit 0aa82c482ab2ece530a6f44897b63b274bb43c8e upstream.

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: 2b31e3aec1db ("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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
arch/powerpc/platforms/pseries/hotplug-memory.c