aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-02-27 01:20:44 -0500
committerDavid S. Miller <davem@davemloft.net>2008-02-27 01:23:31 -0500
commitd9595a7b9c777d45a74774f1428c263a0a47f4c0 (patch)
tree1151c7d17fe6b95f99134d8689876cdae8f491e4 /net
parent78374676efae525094aee45c0aab4bcab95ea9d1 (diff)
[AF_KEY]: Fix oops by converting to proc_net_*().
To make sure the procfs visibility occurs after the ->proc_fs ops are setup, use proc_net_fops_create() and proc_net_remove(). This also fixes an OOPS after module unload in that the name string for remove was wrong, so it wouldn't actually be removed. That bug was introduced by commit 61145aa1a12401ac71bcc450a58c773dd6e2bfb9 ("[KEY]: Clean up proc files creation a bit.") Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/key/af_key.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/key/af_key.c b/net/key/af_key.c
index 1c853927810a..8b5f486ac80f 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -3807,17 +3807,16 @@ static int pfkey_init_proc(void)
3807{ 3807{
3808 struct proc_dir_entry *e; 3808 struct proc_dir_entry *e;
3809 3809
3810 e = create_proc_entry("pfkey", 0, init_net.proc_net); 3810 e = proc_net_fops_create(&init_net, "pfkey", 0, &pfkey_proc_ops);
3811 if (e == NULL) 3811 if (e == NULL)
3812 return -ENOMEM; 3812 return -ENOMEM;
3813 3813
3814 e->proc_fops = &pfkey_proc_ops;
3815 return 0; 3814 return 0;
3816} 3815}
3817 3816
3818static void pfkey_exit_proc(void) 3817static void pfkey_exit_proc(void)
3819{ 3818{
3820 remove_proc_entry("net/pfkey", NULL); 3819 proc_net_remove(&init_net, "pfkey");
3821} 3820}
3822#else 3821#else
3823static inline int pfkey_init_proc(void) 3822static inline int pfkey_init_proc(void)