Skip to content

Commit

Permalink
seq_file: use proc_create() in documentation
Browse files Browse the repository at this point in the history
Using create_proc_entry() + ->proc_fops assignment is racy because
->proc_fops will be NULL for some time, use proc_create() to avoid race.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Alexey Dobriyan authored and Linus Torvalds committed Dec 16, 2009
1 parent 82c1e49 commit 6be4b78
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Documentation/filesystems/seq_file.txt
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,7 @@ code, that is done in the initialization code in the usual way:
{
struct proc_dir_entry *entry;

entry = create_proc_entry("sequence", 0, NULL);
if (entry)
entry->proc_fops = &ct_file_ops;
proc_create("sequence", 0, NULL, &ct_file_ops);
return 0;
}

Expand Down

0 comments on commit 6be4b78

Please sign in to comment.