diff options
Diffstat (limited to 'net/l2tp/l2tp_ip.c')
-rw-r--r-- | net/l2tp/l2tp_ip.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c index ff61124fdf59..3428fba6f2b7 100644 --- a/net/l2tp/l2tp_ip.c +++ b/net/l2tp/l2tp_ip.c | |||
@@ -234,17 +234,13 @@ static void l2tp_ip_close(struct sock *sk, long timeout) | |||
234 | static void l2tp_ip_destroy_sock(struct sock *sk) | 234 | static void l2tp_ip_destroy_sock(struct sock *sk) |
235 | { | 235 | { |
236 | struct sk_buff *skb; | 236 | struct sk_buff *skb; |
237 | struct l2tp_tunnel *tunnel = l2tp_sock_to_tunnel(sk); | 237 | struct l2tp_tunnel *tunnel = sk->sk_user_data; |
238 | 238 | ||
239 | while ((skb = __skb_dequeue_tail(&sk->sk_write_queue)) != NULL) | 239 | while ((skb = __skb_dequeue_tail(&sk->sk_write_queue)) != NULL) |
240 | kfree_skb(skb); | 240 | kfree_skb(skb); |
241 | 241 | ||
242 | if (tunnel) { | 242 | if (tunnel) |
243 | l2tp_tunnel_closeall(tunnel); | 243 | l2tp_tunnel_delete(tunnel); |
244 | sock_put(sk); | ||
245 | } | ||
246 | |||
247 | sk_refcnt_debug_dec(sk); | ||
248 | } | 244 | } |
249 | 245 | ||
250 | static int l2tp_ip_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) | 246 | static int l2tp_ip_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len) |