bluetooth: fix race in bt_procfs_init()
use proc_create_data() rather than set ->data after the file has been created Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
b03166152f
commit
4d006263d3
1 changed files with 1 additions and 7 deletions
|
@ -638,16 +638,10 @@ int bt_procfs_init(struct net *net, const char *name,
|
||||||
struct bt_sock_list* sk_list,
|
struct bt_sock_list* sk_list,
|
||||||
int (* seq_show)(struct seq_file *, void *))
|
int (* seq_show)(struct seq_file *, void *))
|
||||||
{
|
{
|
||||||
struct proc_dir_entry * pde;
|
|
||||||
|
|
||||||
sk_list->custom_seq_show = seq_show;
|
sk_list->custom_seq_show = seq_show;
|
||||||
|
|
||||||
pde = proc_create(name, 0, net->proc_net, &bt_fops);
|
if (!proc_create_data(name, 0, net->proc_net, &bt_fops, sk_list))
|
||||||
if (!pde)
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
pde->data = sk_list;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue