]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/route.c
[NET]: Corrects a bug in ip_rt_acct_read()
[linux-2.6-omap-h63xx.git] / net / ipv4 / route.c
index 1bff9ed349ff5a9e5d14ba1f09888e304bd88950..c426dec6d57903467fd5cd7a233a872efa0524ce 100644 (file)
@@ -2888,18 +2888,14 @@ static int ip_rt_acct_read(char *buffer, char **start, off_t offset,
        offset /= sizeof(u32);
 
        if (length > 0) {
-               u32 *src = ((u32 *) IP_RT_ACCT_CPU(0)) + offset;
                u32 *dst = (u32 *) buffer;
 
-               /* Copy first cpu. */
                *start = buffer;
-               memcpy(dst, src, length);
+               memset(dst, 0, length);
 
-               /* Add the other cpus in, one int at a time */
                for_each_possible_cpu(i) {
                        unsigned int j;
-
-                       src = ((u32 *) IP_RT_ACCT_CPU(i)) + offset;
+                       u32 *src = ((u32 *) IP_RT_ACCT_CPU(i)) + offset;
 
                        for (j = 0; j < length/4; j++)
                                dst[j] += src[j];