Skip to content

Commit

Permalink
[IPV4]: 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 4436f4c commit 7702072
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,12 +542,11 @@ static __init int ip_rt_proc_init(struct net *net)
if (!pde)
goto err1;

pde = create_proc_entry("rt_cache", S_IRUGO, net->proc_net_stat);
pde = proc_create("rt_cache", S_IRUGO,
net->proc_net_stat, &rt_cpu_seq_fops);
if (!pde)
goto err2;

pde->proc_fops = &rt_cpu_seq_fops;

#ifdef CONFIG_NET_CLS_ROUTE
pde = create_proc_read_entry("rt_acct", 0, net->proc_net,
ip_rt_acct_read, NULL);
Expand Down

0 comments on commit 7702072

Please sign in to comment.