summaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_gre.c
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-10-19 02:39:26 +0200
committerDavid S. Miller <davem@davemloft.net>2010-10-19 12:50:48 +0200
commit8723e1b4ad9be4444423b4d41509ce859a629649 (patch)
tree00b0121c12e62736807e998b22b8964f1a5e1df9 /net/ipv4/ip_gre.c
parentnet: avoid a dev refcount in ip_mc_find_dev() (diff)
downloadlinux-8723e1b4ad9be4444423b4d41509ce859a629649.tar.xz
linux-8723e1b4ad9be4444423b4d41509ce859a629649.zip
inet: RCU changes in inetdev_by_index()
Convert inetdev_by_index() to not increment in_dev refcount. Callers hold RCU or RTNL, and should not decrement in_dev refcount. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_gre.c')
-rw-r--r--net/ipv4/ip_gre.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 9d421f4cf3ef..d0ffcbe369b7 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -1245,10 +1245,8 @@ static int ipgre_close(struct net_device *dev)
if (ipv4_is_multicast(t->parms.iph.daddr) && t->mlink) {
struct in_device *in_dev;
in_dev = inetdev_by_index(dev_net(dev), t->mlink);
- if (in_dev) {
+ if (in_dev)
ip_mc_dec_group(in_dev, t->parms.iph.daddr);
- in_dev_put(in_dev);
- }
}
return 0;
}