* [PATCH] pppoe: drop pppoe device in pppoe_unbind_sock_work
@ 2015-05-09 21:08 Felix Fietkau
2015-05-11 16:58 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Felix Fietkau @ 2015-05-09 21:08 UTC (permalink / raw)
To: netdev
After receiving a PADT and the socket is closed, user space will no
longer drop the reference to the pppoe device.
This leads to errors like this:
[ 488.570000] unregister_netdevice: waiting for eth0.2 to become free. Usage count = 2
Fixes: 287f3a943fe ("pppoe: Use workqueue to die properly when a PADT is received")
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
drivers/net/ppp/pppoe.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ppp/pppoe.c b/drivers/net/ppp/pppoe.c
index ff059e1..6a544f2 100644
--- a/drivers/net/ppp/pppoe.c
+++ b/drivers/net/ppp/pppoe.c
@@ -462,6 +462,10 @@ static void pppoe_unbind_sock_work(struct work_struct *work)
struct sock *sk = sk_pppox(po);
lock_sock(sk);
+ if (po->pppoe_dev) {
+ dev_put(po->pppoe_dev);
+ po->pppoe_dev = NULL;
+ }
pppox_unbind_sock(sk);
release_sock(sk);
sock_put(sk);
--
2.2.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] pppoe: drop pppoe device in pppoe_unbind_sock_work
2015-05-09 21:08 [PATCH] pppoe: drop pppoe device in pppoe_unbind_sock_work Felix Fietkau
@ 2015-05-11 16:58 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-05-11 16:58 UTC (permalink / raw)
To: nbd; +Cc: netdev
From: Felix Fietkau <nbd@openwrt.org>
Date: Sat, 9 May 2015 23:08:38 +0200
> After receiving a PADT and the socket is closed, user space will no
> longer drop the reference to the pppoe device.
> This leads to errors like this:
>
> [ 488.570000] unregister_netdevice: waiting for eth0.2 to become free. Usage count = 2
>
> Fixes: 287f3a943fe ("pppoe: Use workqueue to die properly when a PADT is received")
> Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Applied, thanks Felix.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-05-11 16:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-09 21:08 [PATCH] pppoe: drop pppoe device in pppoe_unbind_sock_work Felix Fietkau
2015-05-11 16:58 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).