summaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorNathan Fontenot <nfont@linux.vnet.ibm.com>2015-04-07 09:53:46 -0500
committerMichael Ellerman <mpe@ellerman.id.au>2015-04-14 09:26:08 +1000
commitb0a478ede669949682b9c698f6146c0065543b91 (patch)
tree4f783ca1b540269e83f2ebab8a846dc7c472b9e4 /arch/powerpc
parent3a29dd6d6f445212ddbcf43a2ba6352127ce9ee8 (diff)
downloadlinux-b0a478ede669949682b9c698f6146c0065543b91.tar.bz2
powerpc/pseries: Correct memory hotplug locking
Memory dlpar handling can return from dlpar_memory() without releasing the device_hotplug lock. Correct this routine to ensure the lock is released. Fixes: 5f97b2a0d176 ("powerpc/pseries: Implement memory hotplug add in the kernel") Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/platforms/pseries/hotplug-memory.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index 742ef88ffd7b..5cefcadd3562 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -562,13 +562,15 @@ int dlpar_memory(struct pseries_hp_errorlog *hp_elog)
lock_device_hotplug();
dn = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory");
- if (!dn)
- return -EINVAL;
+ if (!dn) {
+ rc = -EINVAL;
+ goto dlpar_memory_out;
+ }
prop = dlpar_clone_drconf_property(dn);
if (!prop) {
- of_node_put(dn);
- return -EINVAL;
+ rc = -EINVAL;
+ goto dlpar_memory_out;
}
switch (hp_elog->action) {
@@ -599,6 +601,7 @@ int dlpar_memory(struct pseries_hp_errorlog *hp_elog)
else
dlpar_update_drconf_property(dn, prop);
+dlpar_memory_out:
of_node_put(dn);
unlock_device_hotplug();
return rc;