diff options
-rw-r--r-- | net/ipv4/route.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 1bff9ed349ff..c426dec6d579 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -2888,18 +2888,14 @@ static int ip_rt_acct_read(char *buffer, char **start, off_t offset, | |||
2888 | offset /= sizeof(u32); | 2888 | offset /= sizeof(u32); |
2889 | 2889 | ||
2890 | if (length > 0) { | 2890 | if (length > 0) { |
2891 | u32 *src = ((u32 *) IP_RT_ACCT_CPU(0)) + offset; | ||
2892 | u32 *dst = (u32 *) buffer; | 2891 | u32 *dst = (u32 *) buffer; |
2893 | 2892 | ||
2894 | /* Copy first cpu. */ | ||
2895 | *start = buffer; | 2893 | *start = buffer; |
2896 | memcpy(dst, src, length); | 2894 | memset(dst, 0, length); |
2897 | 2895 | ||
2898 | /* Add the other cpus in, one int at a time */ | ||
2899 | for_each_possible_cpu(i) { | 2896 | for_each_possible_cpu(i) { |
2900 | unsigned int j; | 2897 | unsigned int j; |
2901 | 2898 | u32 *src = ((u32 *) IP_RT_ACCT_CPU(i)) + offset; | |
2902 | src = ((u32 *) IP_RT_ACCT_CPU(i)) + offset; | ||
2903 | 2899 | ||
2904 | for (j = 0; j < length/4; j++) | 2900 | for (j = 0; j < length/4; j++) |
2905 | dst[j] += src[j]; | 2901 | dst[j] += src[j]; |