Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ppp: Remove redundant BUG_ON() check in ppp_pernet

Passing NULL to ppp_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>

authored by

Xu Wang and committed by
David S. Miller
8a3f44a0 36a78867

-2
-2
drivers/net/ppp/ppp_generic.c
··· 296 296 /* per net-namespace data */ 297 297 static inline struct ppp_net *ppp_pernet(struct net *net) 298 298 { 299 - BUG_ON(!net); 300 - 301 299 return net_generic(net, ppp_net_id); 302 300 } 303 301