l2tp: avoid duplicate l2tp_pernet() calls
authorGuillaume Nault <g.nault@alphalink.fr>
Mon, 25 Jun 2018 14:07:24 +0000 (16:07 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 26 Jun 2018 13:55:51 +0000 (22:55 +0900)
Replace 'l2tp_pernet(tunnel->l2tp_net)' with 'pn', which has been set
on the preceding line.

Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/l2tp/l2tp_core.c

index 96e31f2ae7cd3f2bff734243eeb3ebab82d6d8a9..88c3001531b42ca4c06bae120d79628a68940269 100644 (file)
@@ -322,8 +322,7 @@ int l2tp_session_register(struct l2tp_session *session,
 
        if (tunnel->version == L2TP_HDR_VER_3) {
                pn = l2tp_pernet(tunnel->l2tp_net);
-               g_head = l2tp_session_id_hash_2(l2tp_pernet(tunnel->l2tp_net),
-                                               session->session_id);
+               g_head = l2tp_session_id_hash_2(pn, session->session_id);
 
                spin_lock_bh(&pn->l2tp_session_hlist_lock);