@@ -1164,7 +1164,6 @@ EXPORT_SYMBOL_GPL(l2tp_xmit_skb);
1164
1164
static void l2tp_tunnel_destruct (struct sock * sk )
1165
1165
{
1166
1166
struct l2tp_tunnel * tunnel = l2tp_tunnel (sk );
1167
- struct l2tp_net * pn ;
1168
1167
1169
1168
if (tunnel == NULL )
1170
1169
goto end ;
@@ -1187,12 +1186,6 @@ static void l2tp_tunnel_destruct(struct sock *sk)
1187
1186
sk -> sk_destruct = tunnel -> old_sk_destruct ;
1188
1187
sk -> sk_user_data = NULL ;
1189
1188
1190
- /* Remove the tunnel struct from the tunnel list */
1191
- pn = l2tp_pernet (tunnel -> l2tp_net );
1192
- spin_lock_bh (& pn -> l2tp_tunnel_list_lock );
1193
- list_del_rcu (& tunnel -> list );
1194
- spin_unlock_bh (& pn -> l2tp_tunnel_list_lock );
1195
-
1196
1189
/* Call the original destructor */
1197
1190
if (sk -> sk_destruct )
1198
1191
(* sk -> sk_destruct )(sk );
@@ -1271,6 +1264,7 @@ static void l2tp_tunnel_del_work(struct work_struct *work)
1271
1264
del_work );
1272
1265
struct sock * sk = tunnel -> sock ;
1273
1266
struct socket * sock = sk -> sk_socket ;
1267
+ struct l2tp_net * pn ;
1274
1268
1275
1269
l2tp_tunnel_closeall (tunnel );
1276
1270
@@ -1284,6 +1278,12 @@ static void l2tp_tunnel_del_work(struct work_struct *work)
1284
1278
}
1285
1279
}
1286
1280
1281
+ /* Remove the tunnel struct from the tunnel list */
1282
+ pn = l2tp_pernet (tunnel -> l2tp_net );
1283
+ spin_lock_bh (& pn -> l2tp_tunnel_list_lock );
1284
+ list_del_rcu (& tunnel -> list );
1285
+ spin_unlock_bh (& pn -> l2tp_tunnel_list_lock );
1286
+
1287
1287
/* drop initial ref */
1288
1288
l2tp_tunnel_dec_refcount (tunnel );
1289
1289
0 commit comments