Skip to content

Commit

Permalink
powerpc/numa: Avoid possible reference beyond prop. length in find_mi…
Browse files Browse the repository at this point in the history
…n_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>
  • Loading branch information
Milton Miller authored and Benjamin Herrenschmidt committed Feb 11, 2009
1 parent 6a4d7a9 commit 20fcefe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/powerpc/mm/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 20fcefe

Please sign in to comment.