From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-Id: <20130911042858.909213255@goodmis.org> Date: Wed, 11 Sep 2013 00:27:47 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Stephen Hemminger , Saurabh Mohan , "David S. Miller" , Cong Wang Subject: [040/251] vti: remove duplicated code to fix a memory leak References: <20130911042707.738353451@goodmis.org> Content-Disposition: inline; filename=0040-vti-remove-duplicated-code-to-fix-a-memory-leak.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: 3.6.11.9-rc1 stable review patch. If anyone has any objections, please let me know. ------------------ From: Cong Wang [ Upstream commit ab6c7a0a43c2eaafa57583822b619b22637b49c7 ] vti module allocates dev->tstats twice: in vti_fb_tunnel_init() and in vti_tunnel_init(), this lead to a memory leak of dev->tstats. Just remove the duplicated operations in vti_fb_tunnel_init(). (candidate for -stable) Cc: Stephen Hemminger Cc: Saurabh Mohan Cc: "David S. Miller" Signed-off-by: Cong Wang Acked-by: Stephen Hemminger Signed-off-by: David S. Miller Signed-off-by: Steven Rostedt --- net/ipv4/ip_vti.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip_vti.c index bf89b21..ab37b31 100644 --- a/net/ipv4/ip_vti.c +++ b/net/ipv4/ip_vti.c @@ -664,17 +664,10 @@ static int __net_init vti_fb_tunnel_init(struct net_device *dev) struct iphdr *iph = &tunnel->parms.iph; struct vti_net *ipn = net_generic(dev_net(dev), vti_net_id); - tunnel->dev = dev; - strcpy(tunnel->parms.name, dev->name); - iph->version = 4; iph->protocol = IPPROTO_IPIP; iph->ihl = 5; - dev->tstats = alloc_percpu(struct pcpu_tstats); - if (!dev->tstats) - return -ENOMEM; - dev_hold(dev); rcu_assign_pointer(ipn->tunnels_wc[0], tunnel); return 0; -- 1.7.10.4