Skip to contentSkip to conversation

kprobes: Use debugfs_remove_recursive instead debugfs_remove

PATCH In review Wang Long 2 participants 2 messages Jul 16, 2015 kprobes

lore
Share & tools
lore

Wang Long

author
#0 lore raw

PATCH 1/1 kprobes: Use debugfs_remove_recursive instead debugfs_remove

In debugfs_kprobe_init, we create a directory 'kprobes' and three files 'list', 'enabled' and 'blacklist'. When any one of the three files creation fails, we should remove all of them. But debugfs_remove function can not complete this work. So use debugfs_remove_recursive instead.

---
 kernel/kprobes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/kprobes.c +1 -1
index c90e417..8cd82a5 100644
@@ -2459,7 +2459,7 @@ static int __init debugfs_kprobe_init(void)
 	return 0;
 
 error:
-	debugfs_remove(dir);
+	debugfs_remove_recursive(dir);
 	return -ENOMEM;
 }
 
Signature · 1 line
1.8.3.4
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Wang Long

In debugfs_kprobe_init, we create a directory 'kprobes' and three files 'list', 'enabled' and 'blacklist'. When any one of the three files creation fails, we should remove all of them. But debugfs_remove function can not complete this work. So use debugfs_remove_recursive instead.

OK, it should be fixed.

Thank you!

Quoted 19 lines
---
 kernel/kprobes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/kprobes.c +1 -1
index c90e417..8cd82a5 100644
@@ -2459,7 +2459,7 @@ static int __init debugfs_kprobe_init(void)
 	return 0;
 
 error:
-	debugfs_remove(dir);
+	debugfs_remove_recursive(dir);
 	return -ENOMEM;
 }
 
Signature · 5 lines
Masami HIRAMATSU
Linux Technology Research Center, System Productivity Research Dept.
Center for Technology Innovation - Systems Engineering
Hitachi, Ltd., Research & Development Group
E-mail: [email protected]