summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2006-04-03 20:11:57 +1000
committerGreg Kroah-Hartman <gregkh@suse.de>2006-04-07 09:44:29 -0700
commit781fe700a871a2fd4efd2e4beaba8c16e19d3e3b (patch)
tree54f0663f32718265e0bdac97b0803fd85480d461 /drivers
parent9f45b01aa6885323f18fe56e3fe19a6df5b7f1e9 (diff)
[PATCH] Fix NULL pointer dereference in node_read_numastat()
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: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-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)
other_node = 0;
for (i = 0; i < MAX_NR_ZONES; i++) {
struct zone *z = &pg->node_zones[i];
- for (cpu = 0; cpu < NR_CPUS; cpu++) {
+ for_each_online_cpu(cpu) {
struct per_cpu_pageset *ps = zone_pcp(z,cpu);
numa_hit += ps->numa_hit;
numa_miss += ps->numa_miss;