Commit 99469c32f79a32d8481f87be0d3c66dad286f4ec

Authored by xeb@mail.ru
Committed by David S. Miller
1 parent e2c53be223

l2tp: avoid to use synchronize_rcu in tunnel free function

Avoid to use synchronize_rcu in l2tp_tunnel_free because context may be
atomic.

Signed-off-by: Dmitry Kozlov <xeb@mail.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 2 changed files with 2 additions and 2 deletions Side-by-side Diff

net/l2tp/l2tp_core.c
... ... @@ -1347,11 +1347,10 @@
1347 1347 /* Remove from tunnel list */
1348 1348 spin_lock_bh(&pn->l2tp_tunnel_list_lock);
1349 1349 list_del_rcu(&tunnel->list);
  1350 + kfree_rcu(tunnel, rcu);
1350 1351 spin_unlock_bh(&pn->l2tp_tunnel_list_lock);
1351   - synchronize_rcu();
1352 1352  
1353 1353 atomic_dec(&l2tp_tunnel_count);
1354   - kfree(tunnel);
1355 1354 }
1356 1355  
1357 1356 /* Create a socket for the tunnel, if one isn't set up by
net/l2tp/l2tp_core.h
... ... @@ -163,6 +163,7 @@
163 163  
164 164 struct l2tp_tunnel {
165 165 int magic; /* Should be L2TP_TUNNEL_MAGIC */
  166 + struct rcu_head rcu;
166 167 rwlock_t hlist_lock; /* protect session_hlist */
167 168 struct hlist_head session_hlist[L2TP_HASH_SIZE];
168 169 /* hashed list of sessions,