projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6c734fb
)
vti: remove duplicated code to fix a memory leak
author
Cong Wang
<
[email protected]
>
Sat, 29 Jun 2013 05:00:57 +0000
(13:00 +0800)
committer
David S. Miller
<
[email protected]
>
Tue, 2 Jul 2013 06:37:14 +0000
(23:37 -0700)
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 <
[email protected]
>
Cc: Saurabh Mohan <
[email protected]
>
Cc: "David S. Miller" <
[email protected]
>
Signed-off-by: Cong Wang <
[email protected]
>
Acked-by: Stephen Hemminger <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/ipv4/ip_vti.c
patch
|
blob
|
history
diff --git
a/net/ipv4/ip_vti.c
b/net/ipv4/ip_vti.c
index c118f6b576bbb50c6fa909bffa1f40930a7c2750..17cc0ffa8c0d0ea2a3732b76b63be1f85c896778 100644
(file)
--- a/
net/ipv4/ip_vti.c
+++ b/
net/ipv4/ip_vti.c
@@
-606,17
+606,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;