diff options
Diffstat (limited to 'drivers/of/of_numa.c')
-rw-r--r-- | drivers/of/of_numa.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/of/of_numa.c b/drivers/of/of_numa.c index 35c64a4295e0..fe6b13608e51 100644 --- a/drivers/of/of_numa.c +++ b/drivers/of/of_numa.c | |||
@@ -104,9 +104,14 @@ static int __init of_numa_parse_distance_map_v1(struct device_node *map) | |||
104 | distance = of_read_number(matrix, 1); | 104 | distance = of_read_number(matrix, 1); |
105 | matrix++; | 105 | matrix++; |
106 | 106 | ||
107 | if ((nodea == nodeb && distance != LOCAL_DISTANCE) || | ||
108 | (nodea != nodeb && distance <= LOCAL_DISTANCE)) { | ||
109 | pr_err("Invalid distance[node%d -> node%d] = %d\n", | ||
110 | nodea, nodeb, distance); | ||
111 | return -EINVAL; | ||
112 | } | ||
113 | |||
107 | numa_set_distance(nodea, nodeb, distance); | 114 | numa_set_distance(nodea, nodeb, distance); |
108 | pr_debug("distance[node%d -> node%d] = %d\n", | ||
109 | nodea, nodeb, distance); | ||
110 | 115 | ||
111 | /* Set default distance of node B->A same as A->B */ | 116 | /* Set default distance of node B->A same as A->B */ |
112 | if (nodeb > nodea) | 117 | if (nodeb > nodea) |