Patchwork powerpc/mm: dereference OF node "/chosen"

login
register
mail settings
Submitter Gavin Shan
Date May 31, 2012, 3:07 a.m.
Message ID <1338433650-19599-1-git-send-email-shangw@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/162105/
State Accepted
Commit 5b958a7eef9e116c7be516924f27e5c62a9c6914
Delegated to: Michael Ellerman
Headers show

Comments

Gavin Shan - May 31, 2012, 3:07 a.m.
The form affinity for NUMA is set to 1 if the firmware supports
OPAL. Otherwise, we have to retrieve that from OF node "/chosen".
For the latter case, OF node "/chosen" was referred without
dereferencing.

The patch dereference OF node "/chosen" if necessary.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
---
 arch/powerpc/mm/numa.c |    2 ++
 1 file changed, 2 insertions(+)

Patch

diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index b6edbb3..5ca3a15 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -340,6 +340,8 @@  static int __init find_min_common_depth(void)
 				dbg("Using form 1 affinity\n");
 				form1_affinity = 1;
 			}
+
+			of_node_put(chosen);
 		}
 	}