From: Xu Wang Date: Fri, 3 Jan 2020 09:28:16 +0000 (+0000) Subject: l2tp: Remove redundant BUG_ON() check in l2tp_pernet X-Git-Tag: v5.15~4637^2~169 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d2e9d229cfbd73baf33a817a0212233cea7df59a;p=platform%2Fkernel%2Flinux-starfive.git 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 Signed-off-by: David S. Miller --- diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c index f82ea12..c99223c 100644 --- a/net/l2tp/l2tp_core.c +++ b/net/l2tp/l2tp_core.c @@ -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); }