aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2006-04-11 01:52:47 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-04-11 09:18:30 -0400
commit54404e72cd3758e465fb6362f6d71e22b705c589 (patch)
treeaead2791d4e5ea39c0bb57e4d29760d72db07727 /drivers/base
parent29ff2db55196717e2e67e0f04adc833ee7edd491 (diff)
[PATCH] Fix NULL pointer dereference in node_read_numastat()
zone_pcp() only returns valid values if the processor is online. Change node_read_numastat() to only scan online processors. Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/node.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/node.c b/drivers/base/node.c
index 16c513aa4d48..c80c3aeed004 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -106,7 +106,7 @@ static ssize_t node_read_numastat(struct sys_device * dev, char * buf)
106 other_node = 0; 106 other_node = 0;
107 for (i = 0; i < MAX_NR_ZONES; i++) { 107 for (i = 0; i < MAX_NR_ZONES; i++) {
108 struct zone *z = &pg->node_zones[i]; 108 struct zone *z = &pg->node_zones[i];
109 for (cpu = 0; cpu < NR_CPUS; cpu++) { 109 for_each_online_cpu(cpu) {
110 struct per_cpu_pageset *ps = zone_pcp(z,cpu); 110 struct per_cpu_pageset *ps = zone_pcp(z,cpu);
111 numa_hit += ps->numa_hit; 111 numa_hit += ps->numa_hit;
112 numa_miss += ps->numa_miss; 112 numa_miss += ps->numa_miss;