Commit 6a6375db authored by Denis V. Lunev's avatar Denis V. Lunev Committed by Linus Torvalds

sysvipc: use non-racy method for proc entries creation

Use proc_create_data() to make sure that ->proc_fops and ->data be setup
before gluing PDE to main tree.
Signed-off-by: default avatarDenis 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 79da3664
...@@ -165,13 +165,12 @@ void __init ipc_init_proc_interface(const char *path, const char *header, ...@@ -165,13 +165,12 @@ void __init ipc_init_proc_interface(const char *path, const char *header,
iface->ids = ids; iface->ids = ids;
iface->show = show; iface->show = show;
pde = create_proc_entry(path, pde = proc_create_data(path,
S_IRUGO, /* world readable */ S_IRUGO, /* world readable */
NULL /* parent dir */); NULL, /* parent dir */
if (pde) { &sysvipc_proc_fops,
pde->data = iface; iface);
pde->proc_fops = &sysvipc_proc_fops; if (!pde) {
} else {
kfree(iface); kfree(iface);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment