aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/patches-3.10/030-timer_list_fix.patch
blob: ef3c7988fd5bca492580e307a016b3b569ebe083 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Patch by: Nathan Zimmer <nzimmer@sgi.com>

Fixes a regression in the commit
"timer_list: Convert timer list to be a proper seq_file" which causes
/proc/timer_list to return an infinite amount of data


--- a/kernel/time/timer_list.c
+++ b/kernel/time/timer_list.c
@@ -305,24 +305,26 @@ static void *timer_list_start(struct seq
 	if (!*offset) {
 		iter->cpu = -1;
 		iter->now = ktime_to_ns(ktime_get());
-	} else if (iter->cpu >= nr_cpu_ids) {
+	} else {
+		iter->cpu = cpumask_next(iter->cpu, cpu_online_mask);
+		if (iter->cpu >= nr_cpu_ids) {
 #ifdef CONFIG_GENERIC_CLOCKEVENTS
-		if (!iter->second_pass) {
-			iter->cpu = -1;
-			iter->second_pass = true;
-		} else
-			return NULL;
+			if (!iter->second_pass) {
+				iter->cpu = -1;
+				iter->second_pass = true;
+			} else
+				return NULL;
 #else
-		return NULL;
+			return NULL;
 #endif
+		}
 	}
+
 	return iter;
 }
 
 static void *timer_list_next(struct seq_file *file, void *v, loff_t *offset)
 {
-	struct timer_list_iter *iter = file->private;
-	iter->cpu = cpumask_next(iter->cpu, cpu_online_mask);
 	++*offset;
 	return timer_list_start(file, offset);
 }