@@ -1249,7 +1249,6 @@ EXPORT_SYMBOL_GPL(l2tp_xmit_skb);
1249
1249
static void l2tp_tunnel_destruct (struct sock * sk )
1250
1250
{
1251
1251
struct l2tp_tunnel * tunnel = l2tp_tunnel (sk );
1252
- struct l2tp_net * pn ;
1253
1252
1254
1253
if (tunnel == NULL )
1255
1254
goto end ;
@@ -1272,12 +1271,6 @@ static void l2tp_tunnel_destruct(struct sock *sk)
1272
1271
sk -> sk_destruct = tunnel -> old_sk_destruct ;
1273
1272
sk -> sk_user_data = NULL ;
1274
1273
1275
- /* Remove the tunnel struct from the tunnel list */
1276
- pn = l2tp_pernet (tunnel -> l2tp_net );
1277
- spin_lock_bh (& pn -> l2tp_tunnel_list_lock );
1278
- list_del_rcu (& tunnel -> list );
1279
- spin_unlock_bh (& pn -> l2tp_tunnel_list_lock );
1280
-
1281
1274
/* Call the original destructor */
1282
1275
if (sk -> sk_destruct )
1283
1276
(* sk -> sk_destruct )(sk );
@@ -1359,6 +1352,7 @@ static void l2tp_tunnel_del_work(struct work_struct *work)
1359
1352
del_work );
1360
1353
struct sock * sk = tunnel -> sock ;
1361
1354
struct socket * sock = sk -> sk_socket ;
1355
+ struct l2tp_net * pn ;
1362
1356
1363
1357
l2tp_tunnel_closeall (tunnel );
1364
1358
@@ -1371,6 +1365,12 @@ static void l2tp_tunnel_del_work(struct work_struct *work)
1371
1365
sk_release_kernel (sk );
1372
1366
}
1373
1367
1368
+ /* Remove the tunnel struct from the tunnel list */
1369
+ pn = l2tp_pernet (tunnel -> l2tp_net );
1370
+ spin_lock_bh (& pn -> l2tp_tunnel_list_lock );
1371
+ list_del_rcu (& tunnel -> list );
1372
+ spin_unlock_bh (& pn -> l2tp_tunnel_list_lock );
1373
+
1374
1374
/* drop initial ref */
1375
1375
l2tp_tunnel_dec_refcount (tunnel );
1376
1376
0 commit comments