Skip to content

Commit

Permalink
[SCTP]: Use proc_create() to setup ->proc_fops first
Browse files Browse the repository at this point in the history
Use proc_create() to make sure that ->proc_fops be setup before gluing
PDE to main tree.

Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Wang Chen authored and David S. Miller committed Feb 28, 2008
1 parent 25296d5 commit 160f17e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 2 additions & 3 deletions net/sctp/objcnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,11 @@ void sctp_dbg_objcnt_init(void)
{
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)
printk(KERN_WARNING
"sctp_dbg_objcnt: Unable to create /proc entry.\n");
else
ent->proc_fops = &sctp_objcnt_ops;
}

/* Cleanup the objcount entry in the proc filesystem. */
Expand Down
4 changes: 1 addition & 3 deletions net/sctp/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,10 @@ int __init sctp_snmp_proc_init(void)
{
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)
return -ENOMEM;

p->proc_fops = &sctp_snmp_seq_fops;

return 0;
}

Expand Down

0 comments on commit 160f17e

Please sign in to comment.