linux-ppp.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ppp: Remove redundant BUG_ON() check in ppp_pernet
@ 2019-12-24  9:37 Xu Wang
  2019-12-24 11:42 ` Sergei Shtylyov
  2019-12-28  0:31 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Xu Wang @ 2019-12-24  9:37 UTC (permalink / raw)
  To: paulus; +Cc: davem, linux-ppp, netdev, linux-kernel

Passing NULL to ppp_pernet causes a crash via BUG_ON.
Dereferencing net in net_generici() 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>
---
 drivers/net/ppp/ppp_generic.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
index 3bf8a8b..22cc2cb 100644
--- a/drivers/net/ppp/ppp_generic.c
+++ b/drivers/net/ppp/ppp_generic.c
@@ -296,8 +296,6 @@ static struct class *ppp_class;
 /* per net-namespace data */
 static inline struct ppp_net *ppp_pernet(struct net *net)
 {
-	BUG_ON(!net);
-
 	return net_generic(net, ppp_net_id);
 }
 
-- 
2.7.4

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

end of thread, other threads:[~2019-12-28  0:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-24  9:37 [PATCH] ppp: Remove redundant BUG_ON() check in ppp_pernet Xu Wang
2019-12-24 11:42 ` Sergei Shtylyov
2019-12-28  0:31 ` 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).