summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilton Miller <miltonm@bga.com>2009-01-08 03:19:43 +0100
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-02-11 03:37:58 +0100
commit20fcefe5a0a354b0cc78ec4634d9f72dab5f1ee9 (patch)
tree4ee7d4097a4e88f885cdae12748bb31779e25e5b
parentMerge commit 'gcl/next' into next (diff)
downloadlinux-20fcefe5a0a354b0cc78ec4634d9f72dab5f1ee9.tar.xz
linux-20fcefe5a0a354b0cc78ec4634d9f72dab5f1ee9.zip
powerpc/numa: Avoid possible reference beyond prop. length in find_min_common_depth()
find_min_common_depth() was checking the property length incorrectly. The value is in bytes not cells, and it is using the second entry. Signed-off-By: Milton Miller <miltonm@bga.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r--arch/powerpc/mm/numa.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 7393bd76d698..e26d5e5c22be 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -289,7 +289,7 @@ static int __init find_min_common_depth(void)
ref_points = of_get_property(rtas_root,
"ibm,associativity-reference-points", &len);
- if ((len >= 1) && ref_points) {
+ if ((len >= 2 * sizeof(unsigned int)) && ref_points) {
depth = ref_points[1];
} else {
dbg("NUMA: ibm,associativity-reference-points not found.\n");