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

[IPV4]: 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 4436f4cb
......@@ -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);
......
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