From: Denis V. Lunev Date: Tue, 29 Apr 2008 08:02:12 +0000 (-0700) Subject: sysvipc: use non-racy method for proc entries creation X-Git-Tag: firefly_0821_release~20947 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6a6375db13703b42dd51b28576d444bb73c541b9;p=firefly-linux-kernel-4.4.55.git 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: Denis V. Lunev Cc: Alexey Dobriyan Cc: "Eric W. Biederman" Cc: Nadia Derbey Cc: Pierre Peiffer Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/ipc/util.c b/ipc/util.c index 4c465cb22360..3339177b336c 100644 --- a/ipc/util.c +++ b/ipc/util.c @@ -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); } }