Commit 831f6e64 authored by Hideaki Yoshifuji's avatar Hideaki Yoshifuji

[IPV6]: Use in6_dev_hold/__in6_dev_put in net/ipv6/mcast.c

parent c1a9fe65
...@@ -930,7 +930,7 @@ static void mld_gq_start_timer(struct inet6_dev *idev) ...@@ -930,7 +930,7 @@ static void mld_gq_start_timer(struct inet6_dev *idev)
idev->mc_gq_running = 1; idev->mc_gq_running = 1;
if (!mod_timer(&idev->mc_gq_timer, jiffies+tv+2)) if (!mod_timer(&idev->mc_gq_timer, jiffies+tv+2))
atomic_inc(&idev->refcnt); in6_dev_hold(idev);
} }
static void mld_ifc_start_timer(struct inet6_dev *idev, int delay) static void mld_ifc_start_timer(struct inet6_dev *idev, int delay)
...@@ -938,7 +938,7 @@ static void mld_ifc_start_timer(struct inet6_dev *idev, int delay) ...@@ -938,7 +938,7 @@ static void mld_ifc_start_timer(struct inet6_dev *idev, int delay)
int tv = net_random() % delay; int tv = net_random() % delay;
if (!mod_timer(&idev->mc_ifc_timer, jiffies+tv+2)) if (!mod_timer(&idev->mc_ifc_timer, jiffies+tv+2))
atomic_inc(&idev->refcnt); in6_dev_hold(idev);
} }
/* /*
...@@ -1037,7 +1037,7 @@ int igmp6_event_query(struct sk_buff *skb) ...@@ -1037,7 +1037,7 @@ int igmp6_event_query(struct sk_buff *skb)
/* cancel the interface change timer */ /* cancel the interface change timer */
idev->mc_ifc_count = 0; idev->mc_ifc_count = 0;
if (del_timer(&idev->mc_ifc_timer)) if (del_timer(&idev->mc_ifc_timer))
atomic_dec(&idev->refcnt); __in6_dev_put(idev);
/* clear deleted report items */ /* clear deleted report items */
mld_clear_delrec(idev); mld_clear_delrec(idev);
} else if (len >= 28) { } else if (len >= 28) {
...@@ -1954,10 +1954,10 @@ void ipv6_mc_down(struct inet6_dev *idev) ...@@ -1954,10 +1954,10 @@ void ipv6_mc_down(struct inet6_dev *idev)
read_lock_bh(&idev->lock); read_lock_bh(&idev->lock);
idev->mc_ifc_count = 0; idev->mc_ifc_count = 0;
if (del_timer(&idev->mc_ifc_timer)) if (del_timer(&idev->mc_ifc_timer))
atomic_dec(&idev->refcnt); __in6_dev_put(idev);
idev->mc_gq_running = 0; idev->mc_gq_running = 0;
if (del_timer(&idev->mc_gq_timer)) if (del_timer(&idev->mc_gq_timer))
atomic_dec(&idev->refcnt); __in6_dev_put(idev);
for (i = idev->mc_list; i; i=i->next) for (i = idev->mc_list; i; i=i->next)
igmp6_group_dropped(i); igmp6_group_dropped(i);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment