Commit ef04c1db authored by Salam Noureddine's avatar Salam Noureddine Committed by Greg Kroah-Hartman

ipv6 mcast: use in6_dev_put in timer handlers instead of __in6_dev_put

[ Upstream commit 9260d3e1 ]

It is possible for the timer handlers to run after the call to
ipv6_mc_down so use in6_dev_put instead of __in6_dev_put in the
handler function in order to do proper cleanup when the refcnt
reaches 0. Otherwise, the refcnt can reach zero without the
inet6_dev being destroyed and we end up leaking a reference to
the net_device and see messages like the following,

unregister_netdevice: waiting for eth0 to become free. Usage count = 1

Tested on linux-3.4.43.
Signed-off-by: default avatarSalam Noureddine <noureddine@aristanetworks.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fbf96d75
...@@ -2158,7 +2158,7 @@ static void mld_gq_timer_expire(unsigned long data) ...@@ -2158,7 +2158,7 @@ static void mld_gq_timer_expire(unsigned long data)
idev->mc_gq_running = 0; idev->mc_gq_running = 0;
mld_send_report(idev, NULL); mld_send_report(idev, NULL);
__in6_dev_put(idev); in6_dev_put(idev);
} }
static void mld_ifc_timer_expire(unsigned long data) static void mld_ifc_timer_expire(unsigned long data)
...@@ -2171,7 +2171,7 @@ static void mld_ifc_timer_expire(unsigned long data) ...@@ -2171,7 +2171,7 @@ static void mld_ifc_timer_expire(unsigned long data)
if (idev->mc_ifc_count) if (idev->mc_ifc_count)
mld_ifc_start_timer(idev, idev->mc_maxdelay); mld_ifc_start_timer(idev, idev->mc_maxdelay);
} }
__in6_dev_put(idev); in6_dev_put(idev);
} }
static void mld_ifc_event(struct inet6_dev *idev) static void mld_ifc_event(struct inet6_dev *idev)
......
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