Skip to content

Commit

Permalink
powerpc/pseries: Correct memory hotplug locking
Browse files Browse the repository at this point in the history
Memory dlpar handling can return from dlpar_memory() without releasing the
device_hotplug lock. Correct this routine to ensure the lock is released.

Fixes: 5f97b2a ("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>
  • Loading branch information
Nathan Fontenot authored and Michael Ellerman committed Apr 13, 2015
1 parent 3a29dd6 commit b0a478e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions arch/powerpc/platforms/pseries/hotplug-memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit b0a478e

Please sign in to comment.