When calling debugfs_lookup() the result must have dput() called on it, otherwise the memory will leak over time. To make things simpler, just call debugfs_lookup_and_remove() instead which handles all of the logic at once.
Showing the changes to kernel/fail_function.c (1 of 1 file). Show all
Unified · Split
| @@ -163,10 +163,7 @@ static void fei_debugfs_add_attr(struct fei_attr *attr) · 162 unmodified lines | |||
| 163 | 163 | ||
| 164 | static void fei_debugfs_remove_attr(struct fei_attr *attr) | 164 | static void fei_debugfs_remove_attr(struct fei_attr *attr) |
| 165 | { | 165 | { |
| 166 | struct dentry *dir; | 166 | debugfs_lookup_and_remove(attr->kp.symbol_name, fei_debugfs_dir); |
| 167 | |||
| 168 | dir = debugfs_lookup(attr->kp.symbol_name, fei_debugfs_dir); | ||
| 169 | debugfs_remove_recursive(dir); | ||
| 170 | } | 167 | } |
| 171 | 168 | ||
| 172 | static int fei_kprobe_handler(struct kprobe *kp, struct pt_regs *regs) | 169 | static int fei_kprobe_handler(struct kprobe *kp, struct pt_regs *regs) |