Ver código fonte

l2tp: unregister l2tp_net_ops on failure path

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
WANG Cong 10 anos atrás
pai
commit
67e04c29ec
1 arquivos alterados com 1 adições e 0 exclusões
  1. 1 0
      net/l2tp/l2tp_core.c

+ 1 - 0
net/l2tp/l2tp_core.c

@@ -1871,6 +1871,7 @@ static int __init l2tp_init(void)
 	l2tp_wq = alloc_workqueue("l2tp", WQ_UNBOUND, 0);
 	l2tp_wq = alloc_workqueue("l2tp", WQ_UNBOUND, 0);
 	if (!l2tp_wq) {
 	if (!l2tp_wq) {
 		pr_err("alloc_workqueue failed\n");
 		pr_err("alloc_workqueue failed\n");
+		unregister_pernet_device(&l2tp_net_ops);
 		rc = -ENOMEM;
 		rc = -ENOMEM;
 		goto out;
 		goto out;
 	}
 	}