aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/divert
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-04-29 04:02:30 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 11:06:22 -0400
commitac41cfd19bf77424519b962f8205ede51fceaac6 (patch)
treef0299767b2115dd076e01841ca5cbe3113ef7a02 /drivers/isdn/divert
parenta95609cb0283a23e519e607ff9fc2a4aa77e2532 (diff)
isdn: use non-racy method for proc entries creation
Use proc_create()/proc_create_data() to make sure that ->proc_fops and ->data be setup before gluing PDE to main tree. Add correct ->owner to proc_fops to fix reading/module unloading race. Signed-off-by: Denis V. Lunev <den@openvz.org> Acked-by: Karsten Keil <kkeil@suse.de> Cc: Alexey Dobriyan <adobriyan@gmail.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/isdn/divert')
-rw-r--r--drivers/isdn/divert/divert_procfs.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/isdn/divert/divert_procfs.c b/drivers/isdn/divert/divert_procfs.c
index 4fd4c46892e3..8b256a617c8a 100644
--- a/drivers/isdn/divert/divert_procfs.c
+++ b/drivers/isdn/divert/divert_procfs.c
@@ -288,13 +288,12 @@ divert_dev_init(void)
288 isdn_proc_entry = proc_mkdir("isdn", init_net.proc_net); 288 isdn_proc_entry = proc_mkdir("isdn", init_net.proc_net);
289 if (!isdn_proc_entry) 289 if (!isdn_proc_entry)
290 return (-1); 290 return (-1);
291 isdn_divert_entry = create_proc_entry("divert", S_IFREG | S_IRUGO, isdn_proc_entry); 291 isdn_divert_entry = proc_create("divert", S_IFREG | S_IRUGO,
292 isdn_proc_entry, &isdn_fops);
292 if (!isdn_divert_entry) { 293 if (!isdn_divert_entry) {
293 remove_proc_entry("isdn", init_net.proc_net); 294 remove_proc_entry("isdn", init_net.proc_net);
294 return (-1); 295 return (-1);
295 } 296 }
296 isdn_divert_entry->proc_fops = &isdn_fops;
297 isdn_divert_entry->owner = THIS_MODULE;
298#endif /* CONFIG_PROC_FS */ 297#endif /* CONFIG_PROC_FS */
299 298
300 return (0); 299 return (0);