l2tp: Remove redundant BUG_ON() check in l2tp_pernet

Passing NULL to l2tp_pernet causes a crash via BUG_ON.
Dereferencing net in net_generic() also has the same effect.
This patch removes the redundant BUG_ON check on the same parameter.

Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Xu Wang 2020-01-03 09:28:16 +00:00 committed by David S. Miller
parent 1f62343110
commit d2e9d229cf
1 changed files with 0 additions and 2 deletions

View File

@ -122,8 +122,6 @@ static inline struct l2tp_tunnel *l2tp_tunnel(struct sock *sk)
static inline struct l2tp_net *l2tp_pernet(const struct net *net)
{
BUG_ON(!net);
return net_generic(net, l2tp_net_id);
}