treewide: fix replace nbd@openwrt.org with nbd@nbd.name
[openwrt.org/openwrt.git] / target / linux / generic / patches-3.18 / 081-03-pppoe-drop-pppoe-device-in-pppoe_unbind_sock_work.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From: Felix Fietkau <nbd@openwrt.org>
Date: Sat, 9 May 2015 23:08:38 +0200
Subject: [PATCH] pppoe: drop pppoe device in pppoe_unbind_sock_work
 
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
 
--- a/drivers/net/ppp/pppoe.c
+++ b/drivers/net/ppp/pppoe.c
@@ -464,6 +464,10 @@ static void pppoe_unbind_sock_work(struc
        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);
 
comments