From: Eric Dumazet Date: Tue, 28 Jul 2009 02:36:15 +0000 (+0000) Subject: net: net_assign_generic() fix X-Git-Tag: v2.6.31-rc6~41^2~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=144586301f6af5ae5943a002f030d8c626fa4fdd;p=profile%2Fcommon%2Fkernel-common.git net: net_assign_generic() fix memcpy() should take into account size of pointers, not only number of pointers to copy. Signed-off-by: Eric Dumazet Acked-by: Pavel Emelyanov Signed-off-by: David S. Miller --- diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index b7292a2..1972830 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c @@ -488,7 +488,7 @@ int net_assign_generic(struct net *net, int id, void *data) */ ng->len = id; - memcpy(&ng->ptr, &old_ng->ptr, old_ng->len); + memcpy(&ng->ptr, &old_ng->ptr, old_ng->len * sizeof(void*)); rcu_assign_pointer(net->gen, ng); call_rcu(&old_ng->rcu, net_generic_release);