]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
ppp: Remove redundant BUG_ON() check in ppp_pernet
authorXu Wang <vulab@iscas.ac.cn>
Tue, 24 Dec 2019 09:37:04 +0000 (09:37 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 28 Dec 2019 00:30:52 +0000 (16:30 -0800)
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>
drivers/net/ppp/ppp_generic.c

index 3bf8a8b4298309dcf4843e4f94ba11ccb4d95ebb..22cc2cb9d878ff0256c38cae44f074435a2190cc 100644 (file)
@@ -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);
 }