linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH] error-injection: remove meaningless null pointer check before debugfs_remove_recursive
@ 2018-09-21  1:46 zhong jiang
  2018-09-21  4:49 ` Kees Cook
  0 siblings, 1 reply; 2+ messages in thread
From: zhong jiang @ 2018-09-21  1:46 UTC (permalink / raw)
  To: akpm; +Cc: mhiramat, mingo, tglx, keescook, linux-kernel

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

Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 kernel/fail_function.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/fail_function.c b/kernel/fail_function.c
index bc80a4e..17f75b5 100644
--- a/kernel/fail_function.c
+++ b/kernel/fail_function.c
@@ -173,8 +173,7 @@ static void fei_debugfs_remove_attr(struct fei_attr *attr)
 	struct dentry *dir;
 
 	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)
-- 
1.7.12.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [RESEND PATCH] error-injection: remove meaningless null pointer check before debugfs_remove_recursive
  2018-09-21  1:46 [RESEND PATCH] error-injection: remove meaningless null pointer check before debugfs_remove_recursive zhong jiang
@ 2018-09-21  4:49 ` Kees Cook
  0 siblings, 0 replies; 2+ messages in thread
From: Kees Cook @ 2018-09-21  4:49 UTC (permalink / raw)
  To: zhong jiang
  Cc: Andrew Morton, Masami Hiramatsu, Ingo Molnar, Thomas Gleixner, LKML

On Thu, Sep 20, 2018 at 6:46 PM, zhong jiang <zhongjiang@huawei.com> wrote:
> debugfs_remove_recursive has taken the null pointer into account.
> just remove the null check before debugfs_remove_recursive.
>
> Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>

Acked-by: Kees Cook <keescook@chromium.org>

-Kees

> ---
>  kernel/fail_function.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/kernel/fail_function.c b/kernel/fail_function.c
> index bc80a4e..17f75b5 100644
> --- a/kernel/fail_function.c
> +++ b/kernel/fail_function.c
> @@ -173,8 +173,7 @@ static void fei_debugfs_remove_attr(struct fei_attr *attr)
>         struct dentry *dir;
>
>         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)
> --
> 1.7.12.4
>



-- 
Kees Cook
Pixel Security

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-09-21  4:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-21  1:46 [RESEND PATCH] error-injection: remove meaningless null pointer check before debugfs_remove_recursive zhong jiang
2018-09-21  4:49 ` Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).