Commit 160f17e3 authored by Wang Chen's avatar Wang Chen Committed by David S. Miller

[SCTP]: Use proc_create() to setup ->proc_fops first

Use proc_create() to make sure that ->proc_fops be setup before gluing
PDE to main tree.
Signed-off-by: default avatarWang Chen <wangchen@cn.fujitsu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 25296d59
...@@ -132,12 +132,11 @@ void sctp_dbg_objcnt_init(void) ...@@ -132,12 +132,11 @@ void sctp_dbg_objcnt_init(void)
{ {
struct proc_dir_entry *ent; struct proc_dir_entry *ent;
ent = create_proc_entry("sctp_dbg_objcnt", 0, proc_net_sctp); ent = proc_create("sctp_dbg_objcnt", 0,
proc_net_sctp, &sctp_objcnt_ops);
if (!ent) if (!ent)
printk(KERN_WARNING printk(KERN_WARNING
"sctp_dbg_objcnt: Unable to create /proc entry.\n"); "sctp_dbg_objcnt: Unable to create /proc entry.\n");
else
ent->proc_fops = &sctp_objcnt_ops;
} }
/* Cleanup the objcount entry in the proc filesystem. */ /* Cleanup the objcount entry in the proc filesystem. */
......
...@@ -108,12 +108,10 @@ int __init sctp_snmp_proc_init(void) ...@@ -108,12 +108,10 @@ int __init sctp_snmp_proc_init(void)
{ {
struct proc_dir_entry *p; struct proc_dir_entry *p;
p = create_proc_entry("snmp", S_IRUGO, proc_net_sctp); p = proc_create("snmp", S_IRUGO, proc_net_sctp, &sctp_snmp_seq_fops);
if (!p) if (!p)
return -ENOMEM; return -ENOMEM;
p->proc_fops = &sctp_snmp_seq_fops;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment