Commit 42b0540a authored by Christian Perle's avatar Christian Perle Committed by Greg Kroah-Hartman

proc: snmp6: Use correct type in memset


[ Upstream commit 3500cd73 ]

Reading /proc/net/snmp6 yields bogus values on 32 bit kernels.
Use "u64" instead of "unsigned long" in sizeof().

Fixes: 4a4857b1 ("proc: Reduce cache miss in snmp6_seq_show")
Signed-off-by: default avatarChristian Perle <christian.perle@secunet.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8fc4f0e6
......@@ -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++)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment