[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1207653576-12640-9-git-send-email-den@openvz.org>
Date: Tue, 8 Apr 2008 15:19:16 +0400
From: "Denis V. Lunev" <den@...nvz.org>
To: akpm@...ux-foundation.org
Cc: linux-kernel@...r.kernel.org, "Denis V. Lunev" <den@...nvz.org>
Subject: [PATCH 9/29] 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 <den@...nvz.org>
---
ipc/util.c | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/ipc/util.c b/ipc/util.c
index 4c465cb..3339177 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);
}
}
--
1.5.3.rc5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists