diff options
author | Denis V. Lunev <den@openvz.org> | 2008-04-29 04:02:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-29 11:06:22 -0400 |
commit | a95609cb0283a23e519e607ff9fc2a4aa77e2532 (patch) | |
tree | 053d411aa27dafead6326a70d0ca3482bd2d0494 /drivers/net/ibmveth.c | |
parent | cf7acfab032ff262f42954328cdfd20a5d9aaaac (diff) |
netdev: use non-racy method for proc entries creation
Use proc_create()/proc_create_data() to make sure that ->proc_fops and ->data
be setup before gluing PDE to main tree.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Cc: Jeff Garzik <jgarzik@pobox.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/net/ibmveth.c')
-rw-r--r-- | drivers/net/ibmveth.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c index ce4fc2ec2fe4..00527805e4f1 100644 --- a/drivers/net/ibmveth.c +++ b/drivers/net/ibmveth.c | |||
@@ -1302,13 +1302,10 @@ static void ibmveth_proc_register_adapter(struct ibmveth_adapter *adapter) | |||
1302 | if (ibmveth_proc_dir) { | 1302 | if (ibmveth_proc_dir) { |
1303 | char u_addr[10]; | 1303 | char u_addr[10]; |
1304 | sprintf(u_addr, "%x", adapter->vdev->unit_address); | 1304 | sprintf(u_addr, "%x", adapter->vdev->unit_address); |
1305 | entry = create_proc_entry(u_addr, S_IFREG, ibmveth_proc_dir); | 1305 | entry = proc_create_data(u_addr, S_IFREG, ibmveth_proc_dir, |
1306 | if (!entry) { | 1306 | &ibmveth_proc_fops, adapter); |
1307 | if (!entry) | ||
1307 | ibmveth_error_printk("Cannot create adapter proc entry"); | 1308 | ibmveth_error_printk("Cannot create adapter proc entry"); |
1308 | } else { | ||
1309 | entry->data = (void *) adapter; | ||
1310 | entry->proc_fops = &ibmveth_proc_fops; | ||
1311 | } | ||
1312 | } | 1309 | } |
1313 | return; | 1310 | return; |
1314 | } | 1311 | } |