Commit 54404e72 authored by Christoph Lameter's avatar Christoph Lameter Committed by Linus Torvalds

[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: default avatarChristoph Lameter <clameter@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 29ff2db5
...@@ -106,7 +106,7 @@ static ssize_t node_read_numastat(struct sys_device * dev, char * buf) ...@@ -106,7 +106,7 @@ static ssize_t node_read_numastat(struct sys_device * dev, char * buf)
other_node = 0; other_node = 0;
for (i = 0; i < MAX_NR_ZONES; i++) { for (i = 0; i < MAX_NR_ZONES; i++) {
struct zone *z = &pg->node_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); struct per_cpu_pageset *ps = zone_pcp(z,cpu);
numa_hit += ps->numa_hit; numa_hit += ps->numa_hit;
numa_miss += ps->numa_miss; numa_miss += ps->numa_miss;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment