diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-04-04 19:16:06 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-04-09 14:13:36 -0400 |
commit | 4d006263d3d61413e63784a454b6e3310bd8e6ee (patch) | |
tree | 296c5d8c50ec3ddd32ca196159158c3f2431864a /net/bluetooth | |
parent | b03166152f6da91cec8b66837b309dd3923ea536 (diff) |
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>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/af_bluetooth.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c index 68e6fefb3655..438a8c56938e 100644 --- a/net/bluetooth/af_bluetooth.c +++ b/net/bluetooth/af_bluetooth.c | |||
@@ -638,16 +638,10 @@ int bt_procfs_init(struct net *net, const char *name, | |||
638 | struct bt_sock_list* sk_list, | 638 | struct bt_sock_list* sk_list, |
639 | int (* seq_show)(struct seq_file *, void *)) | 639 | int (* seq_show)(struct seq_file *, void *)) |
640 | { | 640 | { |
641 | struct proc_dir_entry * pde; | ||
642 | |||
643 | sk_list->custom_seq_show = seq_show; | 641 | sk_list->custom_seq_show = seq_show; |
644 | 642 | ||
645 | pde = proc_create(name, 0, net->proc_net, &bt_fops); | 643 | if (!proc_create_data(name, 0, net->proc_net, &bt_fops, sk_list)) |
646 | if (!pde) | ||
647 | return -ENOMEM; | 644 | return -ENOMEM; |
648 | |||
649 | pde->data = sk_list; | ||
650 | |||
651 | return 0; | 645 | return 0; |
652 | } | 646 | } |
653 | 647 | ||