linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] l2tp: Remove redundant BUG_ON() check in l2tp_pernet
@ 2020-01-03  9:28 Xu Wang
  2020-01-03 20:26 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Xu Wang @ 2020-01-03  9:28 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-kernel

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>
---
 net/l2tp/l2tp_core.c | 2 --
 1 file changed, 2 deletions(-)

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);
 }
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] l2tp: Remove redundant BUG_ON() check in l2tp_pernet
  2020-01-03  9:28 [PATCH] l2tp: Remove redundant BUG_ON() check in l2tp_pernet Xu Wang
@ 2020-01-03 20:26 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-01-03 20:26 UTC (permalink / raw)
  To: vulab; +Cc: netdev, linux-kernel

From: Xu Wang <vulab@iscas.ac.cn>
Date: Fri,  3 Jan 2020 09:28:16 +0000

> 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>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-03 20:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-03  9:28 [PATCH] l2tp: Remove redundant BUG_ON() check in l2tp_pernet Xu Wang
2020-01-03 20:26 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).