aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/mm/debug_pagetables.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/arch/x86/mm/debug_pagetables.c b/arch/x86/mm/debug_pagetables.c
index bfcffdf6c577..d1449fb6dc7a 100644
--- a/arch/x86/mm/debug_pagetables.c
+++ b/arch/x86/mm/debug_pagetables.c
@@ -22,21 +22,26 @@ static const struct file_operations ptdump_fops = {
22 .release = single_release, 22 .release = single_release,
23}; 23};
24 24
25static struct dentry *pe; 25static struct dentry *dir, *pe;
26 26
27static int __init pt_dump_debug_init(void) 27static int __init pt_dump_debug_init(void)
28{ 28{
29 pe = debugfs_create_file("kernel_page_tables", S_IRUSR, NULL, NULL, 29 dir = debugfs_create_dir("page_tables", NULL);
30 &ptdump_fops); 30 if (!dir)
31 if (!pe)
32 return -ENOMEM; 31 return -ENOMEM;
33 32
33 pe = debugfs_create_file("kernel", 0400, dir, NULL, &ptdump_fops);
34 if (!pe)
35 goto err;
34 return 0; 36 return 0;
37err:
38 debugfs_remove_recursive(dir);
39 return -ENOMEM;
35} 40}
36 41
37static void __exit pt_dump_debug_exit(void) 42static void __exit pt_dump_debug_exit(void)
38{ 43{
39 debugfs_remove_recursive(pe); 44 debugfs_remove_recursive(dir);
40} 45}
41 46
42module_init(pt_dump_debug_init); 47module_init(pt_dump_debug_init);