aboutsummaryrefslogtreecommitdiffstats
path: root/net/phonet/pn_dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/phonet/pn_dev.c')
-rw-r--r--net/phonet/pn_dev.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c
index b0d6ddd82a9d..5107b7949c9c 100644
--- a/net/phonet/pn_dev.c
+++ b/net/phonet/pn_dev.c
@@ -218,6 +218,11 @@ static int phonet_init_net(struct net *net)
218 if (!pnn) 218 if (!pnn)
219 return -ENOMEM; 219 return -ENOMEM;
220 220
221 if (!proc_net_fops_create(net, "phonet", 0, &pn_sock_seq_fops)) {
222 kfree(pnn);
223 return -ENOMEM;
224 }
225
221 INIT_LIST_HEAD(&pnn->pndevs.list); 226 INIT_LIST_HEAD(&pnn->pndevs.list);
222 spin_lock_init(&pnn->pndevs.lock); 227 spin_lock_init(&pnn->pndevs.lock);
223 net_assign_generic(net, phonet_net_id, pnn); 228 net_assign_generic(net, phonet_net_id, pnn);
@@ -233,6 +238,8 @@ static void phonet_exit_net(struct net *net)
233 for_each_netdev(net, dev) 238 for_each_netdev(net, dev)
234 phonet_device_destroy(dev); 239 phonet_device_destroy(dev);
235 rtnl_unlock(); 240 rtnl_unlock();
241
242 proc_net_remove(net, "phonet");
236 kfree(pnn); 243 kfree(pnn);
237} 244}
238 245