[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190126202534.GC7439@wrath>
Date: Sat, 26 Jan 2019 12:25:34 -0800
From: Darren Hart <dvhart@...radead.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH] futex: no need to check return value of debugfs_create
functions
On Tue, Jan 22, 2019 at 04:21:39PM +0100, Greg Kroah-Hartman wrote:
> When calling debugfs functions, there is no need to ever check the
> return value. The function can work or not, but the code logic should
> never do something different based on this.
>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Ingo Molnar <mingo@...hat.com>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Darren Hart <dvhart@...radead.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
As documented, and futexes can't be modules, so no need to check for the dentry.
Reviewed-by: Darren Hart (VMware) <dvhart@...radead.org>
> ---
> kernel/futex.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/kernel/futex.c b/kernel/futex.c
> index be3bff2315ff..c2ed57b084a4 100644
> --- a/kernel/futex.c
> +++ b/kernel/futex.c
> @@ -321,12 +321,8 @@ static int __init fail_futex_debugfs(void)
> if (IS_ERR(dir))
> return PTR_ERR(dir);
>
> - if (!debugfs_create_bool("ignore-private", mode, dir,
> - &fail_futex.ignore_private)) {
> - debugfs_remove_recursive(dir);
> - return -ENOMEM;
> - }
> -
> + debugfs_create_bool("ignore-private", mode, dir,
> + &fail_futex.ignore_private);
> return 0;
> }
>
> --
> 2.20.1
>
>
--
Darren Hart
VMware Open Source Technology Center
Powered by blists - more mailing lists