@@ -1173,7 +1173,6 @@ EXPORT_SYMBOL_GPL(l2tp_xmit_skb);
1173
1173
static void l2tp_tunnel_destruct (struct sock * sk )
1174
1174
{
1175
1175
struct l2tp_tunnel * tunnel = l2tp_tunnel (sk );
1176
- struct l2tp_net * pn ;
1177
1176
1178
1177
if (tunnel == NULL )
1179
1178
goto end ;
@@ -1196,12 +1195,6 @@ static void l2tp_tunnel_destruct(struct sock *sk)
1196
1195
sk -> sk_destruct = tunnel -> old_sk_destruct ;
1197
1196
sk -> sk_user_data = NULL ;
1198
1197
1199
- /* Remove the tunnel struct from the tunnel list */
1200
- pn = l2tp_pernet (tunnel -> l2tp_net );
1201
- spin_lock_bh (& pn -> l2tp_tunnel_list_lock );
1202
- list_del_rcu (& tunnel -> list );
1203
- spin_unlock_bh (& pn -> l2tp_tunnel_list_lock );
1204
-
1205
1198
/* Call the original destructor */
1206
1199
if (sk -> sk_destruct )
1207
1200
(* sk -> sk_destruct )(sk );
@@ -1280,6 +1273,7 @@ static void l2tp_tunnel_del_work(struct work_struct *work)
1280
1273
del_work );
1281
1274
struct sock * sk = tunnel -> sock ;
1282
1275
struct socket * sock = sk -> sk_socket ;
1276
+ struct l2tp_net * pn ;
1283
1277
1284
1278
l2tp_tunnel_closeall (tunnel );
1285
1279
@@ -1293,6 +1287,12 @@ static void l2tp_tunnel_del_work(struct work_struct *work)
1293
1287
}
1294
1288
}
1295
1289
1290
+ /* Remove the tunnel struct from the tunnel list */
1291
+ pn = l2tp_pernet (tunnel -> l2tp_net );
1292
+ spin_lock_bh (& pn -> l2tp_tunnel_list_lock );
1293
+ list_del_rcu (& tunnel -> list );
1294
+ spin_unlock_bh (& pn -> l2tp_tunnel_list_lock );
1295
+
1296
1296
/* drop initial ref */
1297
1297
l2tp_tunnel_dec_refcount (tunnel );
1298
1298
0 commit comments