diff mbox

[3.16.y-ckt,stable] Patch "powerpc/pseries: Fix possible leaked device node reference" has been added to staging queue

Message ID 1436779460-23397-1-git-send-email-luis.henriques@canonical.com
State New
Headers show

Commit Message

Luis Henriques July 13, 2015, 9:24 a.m. UTC
This is a note to let you know that I have just added a patch titled

    powerpc/pseries: Fix possible leaked device node reference

to the linux-3.16.y-queue branch of the 3.16.y-ckt extended stable tree 
which can be found at:

    http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.16.y-queue

This patch is scheduled to be released in version 3.16.7-ckt15.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.16.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

From 97a93ba33f5ef1995e4c1a55dd2264be74014980 Mon Sep 17 00:00:00 2001
From: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Date: Wed, 29 Apr 2015 20:44:58 -0500
Subject: powerpc/pseries: Fix possible leaked device node reference

commit 2222ce0fbbcc4ebfa9995c8d23d72c8239ad712c upstream.

Failure return from dlpar_configure_connector when dlpar adding cpus
results in leaking references to the cpus parent device node. Move the
call to of_node_put() prior to checking the result of
dlpar_configure_connector.

Fixes: 8d5ff320766f ("powerpc/pseries: Make dlpar_configure_connector parent node aware")

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 arch/powerpc/platforms/pseries/dlpar.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox

Patch

diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c
index 06685498b681..7d82a2321fc7 100644
--- a/arch/powerpc/platforms/pseries/dlpar.c
+++ b/arch/powerpc/platforms/pseries/dlpar.c
@@ -416,11 +416,10 @@  static ssize_t dlpar_cpu_probe(const char *buf, size_t count)
 		return -ENODEV;

 	dn = dlpar_configure_connector(drc_index, parent);
+	of_node_put(parent);
 	if (!dn)
 		return -EINVAL;

-	of_node_put(parent);
-
 	rc = dlpar_attach_node(dn);
 	if (rc) {
 		dlpar_release_drc(drc_index);