diff options
-rw-r--r-- | drivers/cpufreq/cpufreq_stats.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c index 070421a5480e..ef09e069433b 100644 --- a/drivers/cpufreq/cpufreq_stats.c +++ b/drivers/cpufreq/cpufreq_stats.c | |||
@@ -114,7 +114,7 @@ show_trans_table(struct cpufreq_policy *policy, char *buf) | |||
114 | stat->freq_table[i]); | 114 | stat->freq_table[i]); |
115 | } | 115 | } |
116 | if (len >= PAGE_SIZE) | 116 | if (len >= PAGE_SIZE) |
117 | return len; | 117 | return PAGE_SIZE; |
118 | 118 | ||
119 | len += snprintf(buf + len, PAGE_SIZE - len, "\n"); | 119 | len += snprintf(buf + len, PAGE_SIZE - len, "\n"); |
120 | 120 | ||
@@ -131,8 +131,12 @@ show_trans_table(struct cpufreq_policy *policy, char *buf) | |||
131 | len += snprintf(buf + len, PAGE_SIZE - len, "%9u ", | 131 | len += snprintf(buf + len, PAGE_SIZE - len, "%9u ", |
132 | stat->trans_table[i*stat->max_state+j]); | 132 | stat->trans_table[i*stat->max_state+j]); |
133 | } | 133 | } |
134 | if (len >= PAGE_SIZE) | ||
135 | break; | ||
134 | len += snprintf(buf + len, PAGE_SIZE - len, "\n"); | 136 | len += snprintf(buf + len, PAGE_SIZE - len, "\n"); |
135 | } | 137 | } |
138 | if (len >= PAGE_SIZE) | ||
139 | return PAGE_SIZE; | ||
136 | return len; | 140 | return len; |
137 | } | 141 | } |
138 | CPUFREQ_STATDEVICE_ATTR(trans_table,0444,show_trans_table); | 142 | CPUFREQ_STATDEVICE_ATTR(trans_table,0444,show_trans_table); |