Explorar o código

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 %!s(int64=10) %!d(string=hai) anos
pai
achega
67e04c29ec
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  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);
 	if (!l2tp_wq) {
 		pr_err("alloc_workqueue failed\n");
+		unregister_pernet_device(&l2tp_net_ops);
 		rc = -ENOMEM;
 		goto out;
 	}