aboutsummaryrefslogtreecommitdiff
path: root/net/l2tp/l2tp_core.c
diff options
context:
space:
mode:
authorAmit Pundir <amit.pundir@linaro.org>2017-11-20 21:48:45 +0530
committerAmit Pundir <amit.pundir@linaro.org>2017-11-20 21:48:45 +0530
commitbaa6b7f93aec81644160ca02a8a6a5ae3be4ce85 (patch)
tree2a6bf027912ae74a354ce3b7d460d04ccfac4e55 /net/l2tp/l2tp_core.c
parent7bc703cde6592016ed3eadd8bd592ee9adbe6647 (diff)
parentf409333f361fed0c71c479b2a0c4e032d496cd94 (diff)
Merge branch 'linux-linaro-lsk-v3.18' into linux-linaro-lsk-v3.18-androidlsk-v3.18-18.03-androidlsk-v3.18-18.02-androidlsk-v3.18-17.11-androidlinux-linaro-lsk-v3.18-android
Conflicts: net/packet/af_packet.c Fix conflicts by refactoring changes from LTS commit e4ffdf9ead59 ("packet: hold bind lock when rebinding to fanout hook"), to align with the changes from AOSP commit 6bec212418d2 ("UPSTREAM: packet: fix races in fanout_add()"). Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Diffstat (limited to 'net/l2tp/l2tp_core.c')
-rw-r--r--net/l2tp/l2tp_core.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
index 508154a04558..b5f3c175331c 100644
--- a/net/l2tp/l2tp_core.c
+++ b/net/l2tp/l2tp_core.c
@@ -1317,6 +1317,9 @@ static void l2tp_tunnel_del_work(struct work_struct *work)
struct sock *sk = NULL;
tunnel = container_of(work, struct l2tp_tunnel, del_work);
+
+ l2tp_tunnel_closeall(tunnel);
+
sk = l2tp_tunnel_sock_lookup(tunnel);
if (!sk)
goto out;
@@ -1639,15 +1642,12 @@ EXPORT_SYMBOL_GPL(l2tp_tunnel_create);
/* This function is used by the netlink TUNNEL_DELETE command.
*/
-int l2tp_tunnel_delete(struct l2tp_tunnel *tunnel)
+void l2tp_tunnel_delete(struct l2tp_tunnel *tunnel)
{
- l2tp_tunnel_inc_refcount(tunnel);
- l2tp_tunnel_closeall(tunnel);
- if (false == queue_work(l2tp_wq, &tunnel->del_work)) {
- l2tp_tunnel_dec_refcount(tunnel);
- return 1;
+ if (!test_and_set_bit(0, &tunnel->dead)) {
+ l2tp_tunnel_inc_refcount(tunnel);
+ queue_work(l2tp_wq, &tunnel->del_work);
}
- return 0;
}
EXPORT_SYMBOL_GPL(l2tp_tunnel_delete);