]> git.baikalelectronics.ru Git - kernel.git/commitdiff
proc: snmp6: Use correct type in memset
authorChristian Perle <christian.perle@secunet.com>
Mon, 12 Jun 2017 08:06:57 +0000 (10:06 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 12 Jun 2017 13:53:14 +0000 (09:53 -0400)
Reading /proc/net/snmp6 yields bogus values on 32 bit kernels.
Use "u64" instead of "unsigned long" in sizeof().

Fixes: 60973a559baf ("proc: Reduce cache miss in snmp6_seq_show")
Signed-off-by: Christian Perle <christian.perle@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/proc.c

index cc8e3ae9ca736490c3f689297d190f930fdd2ac9..e88bcb8ff0fd73b8377f5e0d3c3d1fa524ef1da8 100644 (file)
@@ -219,7 +219,7 @@ static void snmp6_seq_show_item64(struct seq_file *seq, void __percpu *mib,
        u64 buff64[SNMP_MIB_MAX];
        int i;
 
-       memset(buff64, 0, sizeof(unsigned long) * SNMP_MIB_MAX);
+       memset(buff64, 0, sizeof(u64) * SNMP_MIB_MAX);
 
        snmp_get_cpu_field64_batch(buff64, itemlist, mib, syncpoff);
        for (i = 0; itemlist[i].name; i++)