Skip to contentSkip to conversation

error-injection: remove meaningless null pointer check before debugfs_remove_recursive

PATCH zhong jiang 1 participant 1 message Sep 10, 2018 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 17 lines · Ingo Molnar
Quoted 15 lines · zhong jiang

debugfs_remove_recursive has taken the null pointer into account. just remove the null check before debugfs_remove_recursive.

---
 kernel/fail_function.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
kernel/fail_function.c +0 -0
index bc80a4e..17f75b5 100644
@@ -173,8 +173,7 @@ static void fei_debugfs_remove_attr(struct fei_attr *attr)
 	struct dentry *dir;
 
Quoted 8 lines

kernel/fail_function.c static void fei_debugfs_remove_attr(struct fei_attr *attr) · line 179

Quoted 7 lines
kernel/fail_function.c +1 -2
 	dir = debugfs_lookup(attr->kp.symbol_name, fei_debugfs_dir);
-	if (dir)
-		debugfs_remove_recursive(dir);
+	debugfs_remove_recursive(dir);
 }
 
 static int fei_kprobe_handler(struct kprobe *kp, struct pt_regs *regs)

Please Cc: such patches to lkml and akpm.

Ok, will do.

Quoted 5 lines

Thanks,

Ingo