diff options
Diffstat (limited to 'net/phonet/pn_dev.c')
-rw-r--r-- | net/phonet/pn_dev.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c index c2b77a698695..5ae4c01e8388 100644 --- a/net/phonet/pn_dev.c +++ b/net/phonet/pn_dev.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/net.h> | 27 | #include <linux/net.h> |
28 | #include <linux/netdevice.h> | 28 | #include <linux/netdevice.h> |
29 | #include <linux/phonet.h> | 29 | #include <linux/phonet.h> |
30 | #include <linux/proc_fs.h> | ||
30 | #include <net/sock.h> | 31 | #include <net/sock.h> |
31 | #include <net/netns/generic.h> | 32 | #include <net/netns/generic.h> |
32 | #include <net/phonet/pn_dev.h> | 33 | #include <net/phonet/pn_dev.h> |
@@ -218,6 +219,11 @@ static int phonet_init_net(struct net *net) | |||
218 | if (!pnn) | 219 | if (!pnn) |
219 | return -ENOMEM; | 220 | return -ENOMEM; |
220 | 221 | ||
222 | if (!proc_net_fops_create(net, "phonet", 0, &pn_sock_seq_fops)) { | ||
223 | kfree(pnn); | ||
224 | return -ENOMEM; | ||
225 | } | ||
226 | |||
221 | INIT_LIST_HEAD(&pnn->pndevs.list); | 227 | INIT_LIST_HEAD(&pnn->pndevs.list); |
222 | spin_lock_init(&pnn->pndevs.lock); | 228 | spin_lock_init(&pnn->pndevs.lock); |
223 | net_assign_generic(net, phonet_net_id, pnn); | 229 | net_assign_generic(net, phonet_net_id, pnn); |
@@ -233,6 +239,8 @@ static void phonet_exit_net(struct net *net) | |||
233 | for_each_netdev(net, dev) | 239 | for_each_netdev(net, dev) |
234 | phonet_device_destroy(dev); | 240 | phonet_device_destroy(dev); |
235 | rtnl_unlock(); | 241 | rtnl_unlock(); |
242 | |||
243 | proc_net_remove(net, "phonet"); | ||
236 | kfree(pnn); | 244 | kfree(pnn); |
237 | } | 245 | } |
238 | 246 | ||