debugfs_remove_recursive() has taken the null pointer into account. just remove the null check before debugfs_remove_recursive().
Showing the changes to kernel/fail_function.c (1 of 1 file). Show all
Unified · Split
| @@ -173,8 +173,7 @@ static void fei_debugfs_remove_attr(struct fei_attr *attr) · 172 unmodified lines | ||
| 173 | 173 | struct dentry *dir; |
| 174 | 174 | |
| 175 | 175 | dir = debugfs_lookup(attr->kp.symbol_name, fei_debugfs_dir); |
| 176 | − if (dir) | |
| 177 | − debugfs_remove_recursive(dir); | |
| 176 | + debugfs_remove_recursive(dir); | |
| 178 | 177 | } |
| 179 | 178 | |
| 180 | 179 | static int fei_kprobe_handler(struct kprobe *kp, struct pt_regs *regs) |