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

net: Remove redundant BUG_ON() check in phonet_pernet

Passing NULL to phonet_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
1f623431 b39c78b2

-2
-2
net/phonet/pn_dev.c
··· 35 35 36 36 static struct phonet_net *phonet_pernet(struct net *net) 37 37 { 38 - BUG_ON(!net); 39 - 40 38 return net_generic(net, phonet_net_id); 41 39 } 42 40