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>
This commit is contained in:
committed by
Linus Torvalds
parent
cf7acfab03
commit
a95609cb02
@@ -1302,13 +1302,10 @@ static void ibmveth_proc_register_adapter(struct ibmveth_adapter *adapter)
|
||||
if (ibmveth_proc_dir) {
|
||||
char u_addr[10];
|
||||
sprintf(u_addr, "%x", adapter->vdev->unit_address);
|
||||
entry = create_proc_entry(u_addr, S_IFREG, ibmveth_proc_dir);
|
||||
if (!entry) {
|
||||
entry = proc_create_data(u_addr, S_IFREG, ibmveth_proc_dir,
|
||||
&ibmveth_proc_fops, adapter);
|
||||
if (!entry)
|
||||
ibmveth_error_printk("Cannot create adapter proc entry");
|
||||
} else {
|
||||
entry->data = (void *) adapter;
|
||||
entry->proc_fops = &ibmveth_proc_fops;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user