|
@@ -1319,7 +1319,7 @@ static void l2tp_tunnel_del_work(struct work_struct *work)
|
|
tunnel = container_of(work, struct l2tp_tunnel, del_work);
|
|
tunnel = container_of(work, struct l2tp_tunnel, del_work);
|
|
sk = l2tp_tunnel_sock_lookup(tunnel);
|
|
sk = l2tp_tunnel_sock_lookup(tunnel);
|
|
if (!sk)
|
|
if (!sk)
|
|
- return;
|
|
|
|
|
|
+ goto out;
|
|
|
|
|
|
sock = sk->sk_socket;
|
|
sock = sk->sk_socket;
|
|
|
|
|
|
@@ -1341,6 +1341,8 @@ static void l2tp_tunnel_del_work(struct work_struct *work)
|
|
}
|
|
}
|
|
|
|
|
|
l2tp_tunnel_sock_put(sk);
|
|
l2tp_tunnel_sock_put(sk);
|
|
|
|
+out:
|
|
|
|
+ l2tp_tunnel_dec_refcount(tunnel);
|
|
}
|
|
}
|
|
|
|
|
|
/* Create a socket for the tunnel, if one isn't set up by
|
|
/* Create a socket for the tunnel, if one isn't set up by
|
|
@@ -1636,8 +1638,13 @@ EXPORT_SYMBOL_GPL(l2tp_tunnel_create);
|
|
*/
|
|
*/
|
|
int l2tp_tunnel_delete(struct l2tp_tunnel *tunnel)
|
|
int l2tp_tunnel_delete(struct l2tp_tunnel *tunnel)
|
|
{
|
|
{
|
|
|
|
+ l2tp_tunnel_inc_refcount(tunnel);
|
|
l2tp_tunnel_closeall(tunnel);
|
|
l2tp_tunnel_closeall(tunnel);
|
|
- return (false == queue_work(l2tp_wq, &tunnel->del_work));
|
|
|
|
|
|
+ if (false == queue_work(l2tp_wq, &tunnel->del_work)) {
|
|
|
|
+ l2tp_tunnel_dec_refcount(tunnel);
|
|
|
|
+ return 1;
|
|
|
|
+ }
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
EXPORT_SYMBOL_GPL(l2tp_tunnel_delete);
|
|
EXPORT_SYMBOL_GPL(l2tp_tunnel_delete);
|
|
|
|
|