summaryrefslogtreecommitdiffstats
path: root/net/ipv4/igmp.c
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-10-19 00:39:18 +0000
committerDavid S. Miller <davem@davemloft.net>2010-10-19 03:50:47 -0700
commit9e917dca74138cccf398ce8bb924c7fd2980ec1d (patch)
tree9aeaa145a5a2b4a513a814eb41f05bd2446ddfe5 /net/ipv4/igmp.c
parent5d6076bb2e642bbcb1263c6cf239b9a1f3d0df08 (diff)
downloadlinux-stable-9e917dca74138cccf398ce8bb924c7fd2980ec1d.tar.gz
linux-stable-9e917dca74138cccf398ce8bb924c7fd2980ec1d.tar.bz2
linux-stable-9e917dca74138cccf398ce8bb924c7fd2980ec1d.zip
net: avoid a dev refcount in ip_mc_find_dev()
We hold RTNL in ip_mc_find_dev(), no need to touch device refcount. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/igmp.c')
-rw-r--r--net/ipv4/igmp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 25f339672b28..a525328ec372 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -1418,6 +1418,7 @@ void ip_mc_destroy_dev(struct in_device *in_dev)
write_unlock_bh(&in_dev->mc_list_lock);
}
+/* RTNL is locked */
static struct in_device *ip_mc_find_dev(struct net *net, struct ip_mreqn *imr)
{
struct flowi fl = { .nl_u = { .ip4_u =
@@ -1433,10 +1434,9 @@ static struct in_device *ip_mc_find_dev(struct net *net, struct ip_mreqn *imr)
return idev;
}
if (imr->imr_address.s_addr) {
- dev = ip_dev_find(net, imr->imr_address.s_addr);
+ dev = __ip_dev_find(net, imr->imr_address.s_addr, false);
if (!dev)
return NULL;
- dev_put(dev);
}
if (!dev && !ip_route_output_key(net, &rt, &fl)) {