Skip to content

Commit

Permalink
sysvipc: use non-racy method for proc entries creation
Browse files Browse the repository at this point in the history
Use 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: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Nadia Derbey <Nadia.Derbey@bull.net>
Cc: Pierre Peiffer <peifferp@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Denis V. Lunev authored and torvalds committed Apr 29, 2008
1 parent 79da366 commit 6a6375d
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions ipc/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,12 @@ void __init ipc_init_proc_interface(const char *path, const char *header,
iface->ids = ids;
iface->show = show;

pde = create_proc_entry(path,
S_IRUGO, /* world readable */
NULL /* parent dir */);
if (pde) {
pde->data = iface;
pde->proc_fops = &sysvipc_proc_fops;
} else {
pde = proc_create_data(path,
S_IRUGO, /* world readable */
NULL, /* parent dir */
&sysvipc_proc_fops,
iface);
if (!pde) {
kfree(iface);
}
}
Expand Down

0 comments on commit 6a6375d

Please sign in to comment.